I am using Oracle 19c. I can get the following to work:
variable max_id number;
exec select 41 into :max_id from dual;
begin
dbms_output.put_line(:max_id);
dbms_output.put_line(:max_id+1);
end;
But splitting the select across multiple lines produces an invalid SQL statement error at the new line:
variable max_id number;
exec select 41
into :max_id from dual; -- invalid SQL statement error points here
begin
dbms_output.put_line(:max_id);
dbms_output.put_line(:max_id+1);
end;
How would I get exec
to work with a multiline query?
You need to sign in to view this answers
Leave feedback about this