Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reason for ddl command in code..!

761387May 26 2010 — edited May 26 2010
Hi all,
many times 1 question is asked to me in interviews,
why we can not use create table command in plsql code without "execute immediate stmnt" in below code.

------------------------------------------------------------------------------------------------------
create procedure p1
as
begin

execute immediate 'create table pctab as select * from emp' ;
execute immediate 'trunccate table pctab' ;

update emp
set sal=100 ;
commit ;

end p1;
----------------------------------------------------------------------------------------------------------------------------------------
kindly ans....why we can not use create table command in plsql code without "execute immediate stmnt" in below code.

regards,
PC
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 23 2010
Added on May 26 2010
6 comments
992 views