Hi Experts,
When I execute the below query, I am getting the output as the SQL query instead of the result rows. Can anybody help me how to get the results rows .
CreateProcedureSREELATR.Parentchild (IN ZSCHEMA NVARCHAR(20),
IN TABLENAME1 NVARCHAR(200),
IN TABLENAME2 NVARCHAR(200),
IN TABLEKEY NVARCHAR(100),
OUT OUT_RESULT NVARCHAR(2000))
LANGUAGE SQLSCRIPT AS
SQLQ NVARCHAR(5000);
BEGIN
EXEC 'SET SCHEMA '||:ZSCHEMA;
OUT_RESULT := 'SELECT distinct '||:TABLEKEY||' from CDW_POC.'||:TABLENAME1||
' MINUS '
'SELECT DISTINCT '||:TABLEKEY||' from CDW_POC.'||:TABLENAME2;
EXECUTE IMMEDIATE :OUT_RESULT;
END;
call SREELATR.PARENTCHILD('SREELATR','SALES','ORDER','SALES-ORD-KEY',?);