Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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()


select 'ss' from dummy; -- this works

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


Any Ideas?

asked 03 Oct '19, 11:32

Baron's gravatar image

accept rate: 48%

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 '19, 14:42

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

converted 04 Oct '19, 05:29


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

(03 Oct '19, 14:44) Volker Barth

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

(04 Oct '19, 04:18) Baron
Replies hidden don't forget to check-mark the answer :)

(04 Oct '19, 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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 03 Oct '19, 11:32

question was seen: 861 times

last updated: 04 Oct '19, 08:40