i'm trying to print out the vSQL variable after the execute immediate statement. i know the execute immediate statement ll give ORA-00903 because u can not bind variables to tables etc.i just want to print that string after using statement.
here is my code :
DECLARE
vSQL VARCHAR2(100);
vOwner VARCHAR2(100);
vTableName VARCHAR2(100);
vPartition VARCHAR2(100);
BEGIN
vOwner := 'STG';
vTableName := 'TEMP';
vSQL := 'ALTER TABLE :1.:2 TRUNCATE PARTITION(:3)';
EXECUTE IMMEDIATE vSQL USING vOwner,vTableName,vPartition;
--DBMS_OUTPUT.PUT_LINE(vSQL); -- Something like this
END;
thx for ideas...
alter tablestatement why is theexecute immediatestatement there? It won't ever be successfully executed anyway unless you drop the idea of trying to bind identifiers.