how to create table with in the procedure or function?
Answers were Sorted based on User's Feedback
Answer / k.l.tharangini
create table using procedure
create procedure test as
begin
EXECUTE IMMEDIATE
'CREATE TABLE emp(empno VARCHAR(10),JOB VARCHAR(10),SAL
NUMBER(10))';
end;
| Is This Answer Correct ? | 43 Yes | 3 No |
Answer / vipin kumar
If we need to create a table in the stored procedure then we need to use the execute immediate and then the string ' create table emp(name varcha2(1000))'
Other then this if we need to create a table which will just store the records (collections) then it will be like
--declare a row first
type employee is record
(Emp_name varchar2(100),
emp_id number);
--
-- Create a table now
--
type tab_employee is table of employee
index by binary_integer;
| Is This Answer Correct ? | 4 Yes | 5 No |
which types of join is used in sql widely? : Sql dba
Mention what does plvtab enables you to do when you showthe contents of pl/sql tables?
Explain how you can copy a file to file content and file to pl/sql table in advance pl/sql?
consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ename who having maximum salary in deptno 10 and 20.
what will be the output: select 1 from emp union all select 2 from emp;
What is the difference between sql/pl-sql/embeded sql?
What are aggregate functions in sql?
what is the difference between cluster and non cluster index? : Sql dba
Can we insert in sql function?
How to perform a loop through all tables in pl/sql?
What is input buffer in sql*plus?
Write a query to get 2nd maximum salary in an employee table ?
69 Answers Accenture, BirlaSoft, Letse, Logica CMG, Qwest, Rheal Software, Saagam, Semantic Space, Tailor Solution, TCS, TinyERP,
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)