Re: Simple ESQL-C Problem on INFORMIX-SE
Posted in 1997
Dirk Niemeier wrote: > > Hallo, > > I want to use statements with variable number of parameters. > Example : > > $update arti set > ar401=ar401 + $menge, > ar406=ar406 - $menge, > ar509=ar509 + $menge, > . > . > ar510=ar510 + $wert, > ar503=ar503 + $menge, > ar504=ar504 + $wert > where ar001=$lgteilnr and ar002=$teilnr; > > The problem is that the number of colums to update is variable. > I could use the prepair/declare/execute mechnism to generate a variable > statement, but the number of input-variables is variable too. > I think the descriptor methode is not usefull in this case, because the > are only two or three kinds of values for the variables. In PL-SQL > ORACLE it > is possible to define local hostvariables, within an begin-end block, > that can > used in the select/update statement. With INFORMIX it is only possible > in SPL Statements !??? Or how can I solve my problem with INFORMIX ? > > best regards > Dirk Niemeier First, You are writing C, so C language spec still apply. [Yes Virgina you can create local variables on the fly.] Second, there is always several ways to skin the cat. Lets say you are in a while() loop. And each statement has a different number of variables. You can of course take care of this in C /esql/C. SPL is a separate issue. Remember that {} is a block ;-) [If you still don't get it, read K&R yet again!] -Drunk and Disorderly Mikey -- #include <std_disclaimer.h> /* Mike Segel (MS385) */ #include <No_Spam.h> #ifdef OFFENDED_BY_CONTENT The author takes no responsibility for this post. Any resembalence to a coherent rational thought is purely coincidence. -The Management. #endif ***************************** Due to AGIS's Refusal to Act Responsibly We are blocking all of their domains at the packet level. This block will exist until AGIS modifies their policies to conform to existing RFCs and net community standards. We encourage all ISPs and domain holders to do the same. *****************************