All Forums Database
talal_ahmad 3 posts Joined 06/06
12 Jul 2006
Problems With Dynamic SQL Execution

I have created a stored procedure and compiled it. This has been done successfully however one little problem that i face is that i have not been able to use the following statement CALL DBC.SysExecSQL('SELECT City_Name into :City ' || ' FROM Maint.City');When i go search for SysExecSQL in the DBC Schema i cannot find it. Looking at the call statement i suppose this is a procedure.Can anyone please help me or guide me with thisThanks

Barry-1604 176 posts Joined 07/05
12 Jul 2006

I believe that you can only execute the call to DBC.SysExecSQL within the context of a stored procedure. It doesn't work as a stand-alone command.When I try calling it, it says it doesn't exist, but within the context of a stored procedure, it works fine.

Fred 1096 posts Joined 08/04
12 Jul 2006

Note that to use DBC.SysExecSQL in a stored procedure, the creator of the SP (the username logging on to issue CREATE PROCEDURE) must be the same as the owner (database / user within which the SP is defined).

You must sign in to leave a comment.