Help!! Using varaibles in an SPL create statement?
Posted in 1999
Topics: Stored Procedures & SPL
I need to create a synonym in a Stored Procedure where the database@servername part is a variable I pass to the procedure, can it be done? Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
strangiato@my-deja.com wrote:
>
> I need to create a synonym in a Stored Procedure where the
> database@servername part is a variable I pass to the procedure, can it
> be done?
No. You cannot build and execute dynamic SQL in a stored procedure.
However you can do a scratch-your-left-ear-with-your-right-elbow thing
and have the stored procedure execute a dbaccess session using SYSTEM
that will create the synonym.
Art S. Kagel
strangiato@my-deja.com wrote: > I need to create a synonym in a Stored Procedure where the > database@servername part is a variable I pass to the procedure, can it > be done? No. SPL doesn't handle dynamic SQL, and to do what you want requires dynamic SQL. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>