Re: Simple ESQL-C Problem on INFORMIX-SE
Posted in 1997
Hi, You can construct your own input descriptor and prepare the statement with placeholders. The input descriptor will contain a column for every column in the SET clause and every column in the WHERE clause. i.e. strcpy(stmt,"UPDATE arti SET ar401=?, ar406=?,.... where ar001=? and ar002=?" EXEC SQL PREPARE up_stmt FROM :stmt; Your input descriptor would consist of all columns being updated and in the where clause. You would then: EXEC SQL EXECUTE up_stmt USING :input_descriptor; -Bill } } 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 } } } } } -- Bill Ennis Voice: 312-474-7516 SSA Fax: 312-474-7460 500 W. Madison email: ennis@ssax.com ennis@accesschicago.net