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 are the benefits of pl sql?

763


How is sql used in oracle?

750


Does inner join remove duplicates?

695


Can we create table inside stored procedure?

694


What is use of package in pl sql?

711






What is the meaning of disabling a trigger?

821


What type of database is sql?

772


What is the difference between execution of triggers and stored procedures?

745


Enlist some predefined exceptions?

795


When is a declare statement required?

863


What are keys in sql?

721


What is the difference between the implicit and explicit cursors?

734


What is the difference between inner join and natural join?

699


What is the process of debugging?

737


How do you rank data in sql?

678