cancel
Showing results for 
Search instead for 
Did you mean: 

create procedure without defined result

Baron
Participant
1,156

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?

Accepted Solutions (1)

Accepted Solutions (1)

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 Kudos

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

Breck_Carter
Participant
0 Kudos

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

Answers (0)