Introduction:
Ø EXECUTE
IMMEDIATE statement is used execute the DDL, DML statements at runtime in
PL/SQL.
Example:
Ø In this example we will know about how to create a table in PL/SQL block.
Ø In
SQL we have no trouble to create a table, but in PL/SQL we are unable to create
table same as SQL, let show the Example,
Create the table in the
PL/SQL Block:
If you run the block we will get this error,
Error report:
To overcome this error we will use EXECUTE IMMEDIATE:
DECLARE
v_qry VARCHAR2 (200);
Ex: v_qry VARCHAR2 (200);
Ø
Create query must
be enclosed with single quotes(‘’) and ended with semi colon(;).
PL/SQL
procedure successfully completed.
Describe the Table:
No comments:
Post a Comment