how to create table with in the procedure or function?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the most important ddl statements in sql are?

523


What are views in sql?

547


What if we write return in procedure?

788


What is a data definition language?

558


Why cross join is used?

637






How many sql statements are used? Define them.

576


what is sp_pkeys? : Transact sql

699


Can we join 3 tables in sql?

498


What is query syntax?

523


What is where clause in sql?

537


Will truncate release space?

519


what is a trigger in mysql? : Sql dba

605


Why we use joins in sql?

544


When is a declare statement required?

677


What are sql functions? Describe the different types of sql functions?

561