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

Which is better trigger or stored procedure?

504


Differentiate between syntax and runtime errors.

642


Does mysql support pl sql?

627


Define overloaded procedure?

626


difference between anonymous blocks and sub-programs.

626






Determine if oracle date is on a weekend?

558


What is a scalar value in sql?

594


Is it possible to link two groups inside a cross products after the cross products group has been created?

599


how to create a new table in mysql? : Sql dba

554


Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.

532


How do I truncate a word?

531


What are the types of triggers in sql?

505


What program will open a mdb file?

505


What is update query?

551


How can you fetch first 5 characters of the string?

556