Re: Need help with Stored Procedure (SPL)
Posted in 1998
Hmmmm, dynamic & SPL are not two words that go together well, as you have discovered :-), so no, you can't PREPARE anything in SPL (and DECLARE is a no-no too). Ciao, Marco _______________________________________________________________________________ Marco Greco, Catania, Italy marcog@linux.ctonline.it rem radioterapia +39 95 447828 fax 446558 Informix faq http://www.iiug.org/techinfo/faq/informix.htm 4glworks http://www.ctonline.it/~marcog Informix on Linux http://www.ctonline.it/~marcog/ifmxlinux.htm Jesus Diaz wrote: > > Please I need help with this : > > Im trying to construct a Store Procedure that contains a dynamic QUERY like > this: > > let WDWHERE = "1 = 1"; > let WDSQL = "select a.entry from t2sales a where", > "trc_type <> 'R' and ", > "yymm = '", ps_period ,"' and", WDWHERE, > "and exists (select * from t6sales where yymm=a.yymm", > "and entry=a.entry and line=a.line and ncupon=1", > "and (loc_from='SDQ' and loc_from='POP'))", > "order by entry"; > > -- prepare nuevo from WDSQL > -- declare in_curs cursor for nuevo > -- foreach in_curs into w_entry > -- <Do Something Here> > -- end foreach; > > but the commented sentences doesnt work, the error i got is : "Syntax Error". > Does it is permited in SPL? if not what could i do? > > Thanks > ____________________________ > Jes's D'az Avila > Trans Solutions Systems S.A. > Telf : (511) 241-0110 > Fax : (511) 446-5579 > E-Mail : pcsijdia@upc.edu.pe > ____________________________ >