Hello!I get a bit confused when reading the ESQL/C doc about the DESCRIBE, DESCRIBE OUTPUT and DESCRIBE INPUT statements...What is fully supported and what is recommended today, to get fetch buffer information (SELECT list) as well as input parameters (INSERT/UPDATE/DELETE, and also input parameters of a WHERE clause in SELECT...)?My understanding so far (to not be dependent from the IFX_UPDDESC env var), is to use DESCRIBE OUTPUT to get information about output data info, and DESCRIBE INPUT to get input parameters info...And that the usage of DESCRIBE (without the additional OUTPUT or INPUT keyword) should be avoided because it's deprecated...Is this correct?To write generic ESQL/C executing SQL statements dynamically (only known at runtime), is it then recommended to use DESCRIBE OUTPUT and DESCRIBE INPUT in any case, to get information about output and input parameters?Which one is to be used first (mainly to get the SQL statement type)?Is there some overhead to use these instructions or is all information on the client side avec preparing the SQL statement?https://www.ibm.com/support/knowledgecenter/SSGU8G_14.1.0/com.ibm.sqls.doc/ids_sqs_0688.htmhttps://www.ibm.com/support/knowledgecenter/SSGU8G_14.1.0/com.ibm.sqls.doc/ids_sqs_0689.htm
Thank you Art,It depends what we mean by deprecated... to me it mean still available, but to be avoided and replaced but something new.The page https://www.ibm.com/support/knowledgecenter/SSGU8G_14.1.0/com.ibm.sqls.doc/ids_sqs_0696.htm shows following Tip:Informix versions earlier than 9.40 do not support the INPUT keyword. For compatibility with legacy applications, DESCRIBE without INPUT is supported. In new applications, you should use DESCRIBE INPUT statements to provide information about dynamic parameters in the WHERE clause, in subqueries, and in other syntactic contexts where the old form of DESCRIBE cannot provide information.This sounds to me that the recommended way is to use DESCRIBE INPUT instead of DESCRIBE for input parameters, and logically I would then use DESCRIBE OUTPUT for output params...And with DESCRIBE (without modifier), there is this limitation on UPDATE statements that requires IFX_UPDDESC env var to be set... you should consider this in your tools if you use UPDATE... DELETE params seem to be totally ignored by DESCRIBE not matter if that env var is set.I have tested with code and DESCRIBE OUTPUT / INPUT seems to work much better as DESCRIBE: New statements return sqlda info for INSERT, UPDATE and DELETE (with params in WHERE clause).Simple question: If DESCRIBE alone provides input and output data info, what member of the sqlvar_struct indicates if it's an input, output (or both?) data element?In the following page: https://www.ibm.com/support/knowledgecenter/en/SSGU8G_14.1.0/com.ibm.sqls.doc/ids_sqs_0692.htm I can read:
"For a prepared INSERT or UPDATE statement, DESCRIBE returns only the dynamic parameters (those expressed with a question mark (?) symbol). Using the OUTPUT keyword, however, prevents these from being returned."
The more I read the doc, the more I get confused.So my conclusion is that one should use DESCRIBE INPUT and DESCRIBE OUTPUT and no longer use DESCRIBE.Seb