Re: Stored Procedures
Posted in 1996
Dennis J Pimple <dennisp@informix.com> wrote in article <32722618.78E9@informix.com>... > Manoj Shroff wrote: > > > > Dear All, > > > > Is it possible to reference a variable in a select statement in > > a stored procedure, i.e > > > > Afraid not. All the SQL has to be compiled at creation time, thus no > PREPARE in SPL, and thus no way to do "generic" SQL statements. > You can use SPL variables in SQL statements: SELECT col1 INTO var1 FROM tab1 WHERE col2 = var2; You cannot create SQL statement from string variable: LET str1 = "SELECT col1 FROM tab1 WHERE col2 = 15"; -- PREPARE... - this doesn't work in SPL -- Zdeno Miklas SOFTEC spol. s r. o. e-mail: ash@softec.sk Kutuzovova 23 phone : 42-7-273805 ext.128 831 03 Bratislava fax : 42-7-272537 SLOVAKIA