I have following Store procedure in Oracle 11g. I am passing the table name as parameter through ASP.net using c#. But while running the application i am getting the error "ORA-00923: FROM keyword not found where expected error in oracle".
PROCEDURE "ARCHIVE_FILTERDATA" ( ITYPE IN VARCHAR2, itableName IN VARCHAR2, cur_archive OUT sys_refcursor ) AS
stmt clob;
endstmt clob;
BEGIN
IF ITYPE='Week'
THEN stmt := 'DELETE FROM '|| itableName ||' WHERE CREATEDATE < (SELECT DATE_ADD(CURDATE(), INTERVAL , - 1, WEEK))';
EXECUTE IMMEDIATE stmt;
END IF;
END;
So anybody have a solution please let me know ASAP. Thanks in Advance