Wednesday, October 17, 2012

Execute Immediate

EXECUTE IMMEDIATE:
----------------------------------

One can call DDL statements like CREATE, DROP, TRUNCATE, etc. from PL/SQL by using the "EXECUTE IMMEDIATE" statement (native SQL). Examples:

begin
  EXECUTE IMMEDIATE 'CREATE TABLE X(A DATE)';
end;

begin
execute Immediate 'TRUNCATE TABLE emp';
end;


No comments:

Share your thoughts Join the conversation, ask follow-up questions, or add your experience related to this post.

Post a Comment