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?

asked 03 Oct, 11:32

Sarkis's gravatar image

Sarkis
547293764
accept rate: 20%

Comment Text Removed

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.

permanent link

answered 03 Oct, 14:42

Volker%20Barth's gravatar image

Volker Barth
34.4k335490723
accept rate: 33%

converted 04 Oct, 05:29

1

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

(03 Oct, 14:44) Volker Barth

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

(04 Oct, 04:18) Sarkis
Replies hidden

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

(04 Oct, 08:40) Breck Carter
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×32
×2

question asked: 03 Oct, 11:32

question was seen: 105 times

last updated: 04 Oct, 08:40