Hi,
I have a below procedure but its not returning any rows. please let me know what i am doing wrong.
CREATE PROCEDURE proc_dynamic_result4520(vinput varchar(5000)) AS
BEGIN
declare var_input varchar(5000);
declare sql_str varchar(3000);
var_input := vinput;
if (var_input = 'T') THEN
SQL_STR := 'select "QUERY" into SQL_STR from "Sumeet"."QUERYTABLE"';
execute immediate (:SQL_STR);
end if;
END;
call proc_dynamic_result4520('vinput');
When i am trying to pass 'T' in calling procedure its throwing me an error.
Could not execute 'call proc_dynamic_result4520('T')' in 163 ms 234 µs .
SAP DBTech JDBC: [337]: INTO clause not allowed for this SELECT statement: [337] "Sumeet"."PROC_DYNAMIC_RESULT4520": line 11 col 1 (at pos 260): [337] (range 3) INTO clause not allowed for this SELECT statement exception: INTO clause not allowed for this SELECT statement: line 1 col 17 (at pos 16)
I want to see result as 'select "QUERY" into SQL_STR from "Sumeet"."QUERYTABLE' .
Thanks and Regards
Sumeet