Problems With Dynamic SQL Execution

Database

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 this

Thanks
2 REPLIES
Enthusiast

Re: Problems With Dynamic SQL Execution

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.
Teradata Employee

Re: Problems With Dynamic SQL Execution

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