Hi all,
I'm new to this script languages and my question is
I have 2 tables and want to compare 2 tables and want to delete records from table B if those records does not exisit in table A
for that I need to have write a Stored procedure
so my SP looks as below
CREATE OR REPLACE PROCEDURE SP(
iTABLENAME IN VARCHAR2,
iMODELID IN NUMBER )
AS
BEGIN
EXECUTE IMMEDIATE 'DELETE FROM' || iTABLENAME || 'WHERE vchaccount NOT IN (select VCHCHILDMEMBERNAME
from TabbleA
where' || iMODELID ||' = ''imodelid'' and CHCHILDTYPE = ''D'' and VCHDIMENSIONTYPENAME = ''Account'' );';
END SP;
when I turn this to a script it gives me correct result, but when I ran this as Store Procedure it gives me error: "ORA-06512"
don't know what is wrong