Using DDL Commands In PLSQL
We cannot directly use DDL commands in PL/SQL Code. So, to achieve this we need to first declare a variable in declaration and assign the DDL command to the declared variable in begin section of the PL/SQL Block followed by Execute Immediate statement as below:
DECLARE
ddl_qry VARCHAR2 (150);
BEGIN
ddl_qry:='TRUNCATE TABLE XX_SUPPLIER_OUTST_MAIN_STG';
EXECUTE IMMEDIATE ddl_qry;
mo_global.set_policy_context('S',121);
END
/
No comments:
Post a Comment