cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

create procedure without defined result

Baron
Participant
1,754

I know that it is possible to create a procedure without defining the result of it, but this is true only if I dont execute the select statement within an execute immediate.

create procedure myproc()

begin

select 'ss' from dummy; -- this works

execute immediate ('select ''ss'' from dummy'); -- this does not work

end;

Any Ideas?

View Entire Topic
VolkerBarth
Contributor

Does it work when you add the WITH RESULT SET ON clause, see here...? By default, EXECUTE IMMEDIATE is not supposed to return a result set.

VolkerBarth
Contributor

Besides that, there may be ways to parameterize your statement that do not require dynamic SQL, say by using connection-specific variables...

Baron
Participant
0 Likes

Thank you very much! it has worked with (WITH RESULT SET ON)

Breck_Carter
Participant
0 Likes

...so don't forget to check-mark the answer 🙂