Explain how DDL commands used in a procedure or function?

Questions by madhug56   answers by madhug56

Showing Answers 1 - 2 of 2 Answers

Anurag Puranik

  • Mar 23rd, 2007
 

We can use DDL commands in Procedure & Functions through
"EXECUTE IMMEDIATE " Command

  Was this answer useful?  Yes

Nikhil_4_Oracle

  • Mar 23rd, 2007
 

HI ALL,

try this..,

create or replace procedure ddl_proc
(tabname in varchar2)
as
v_cursor INTEGER;
ddl_exe INTEGER;
begin
v_cursor:=Dbms_sql.open_cursor;
Dbms_sql.Parse(v_cursor,' Create Table '||tabname||' (col1 number(2),col2 varchar2(5)) ',Dbms_sql.native);
ddl_exe:=Dbms_sql.Execute(v_cursor);
dbms_sql.close_cursor(v_cursor);
end ddl_proc;

Thanks & Regards,

Nikhil.
 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions