Wednesday, July 3, 2024

Using DDL Commands In PLSQL

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

EBS : Package Development Process

====================== Package Specification ================================== CREATE OR REPLACE PACKAGE xx_emp_package IS     PROCEDURE lo...