Hi everyone, How can I create a Procedure with dynamic sql to truncate a table name I pass by every time in Oracle? I am running the following query and nothing happens. It neither creates the procedure nor errors out.
CREATE OR REPLACE PROCEDURE TruncateTable(TableName IN VARCHAR2(50))
IS
BEGIN
SQLCmd VARCHAR(200);
BEGIN
SQLCmd := 'TRUNCATE TABLE ' || TableName;
EXECUTE IMMEDIATE SQLCmd;
END;
Could someone please help me?
Thanks