Re: esql/c empty string
Posted in 2004
Hello,
If you are using ESQL/C with CSDK2.81.xC2 or later, you should be
able to make use of an environment variable BLANK_STRINGS_NOT_NULL.
1) If BLANK_STRINGS_NOT_NULL environment variable is set 1,
the string host variable stores an empty string as a single blank
followed by a null terminator.
2) If BLANK_STRINGS_NOT_NULL is not set as an environment variable,
string host variable stores an empty string as a null string (just
null terminator).
This should help you resolve the issue and was specially added for
backward compatibility.
Thanks and Regards,
Abhishek Mathur
Software Engineer, Data Management
IBM Corporation
PH: 913-599-7109 (T/L - 337-7109)
abhishek@us.ibm.com
gluca.rosa@tiscalinet.it (Gianluca)
Sent by: owner-informix-list@iiug.org
12/03/2004 04:56 AM
Please respond to
gluca.rosa@tiscalinet.it (Gianluca)
To
informix-list@iiug.org
cc
Subject
esql/c empty string
I'm using 'char' type host variabile to insert data into a VARCHAR(20,0).
I do the following:
char x[21];
strcpy(x,"");
But I see that value inserted is "NULL".
Therefore I try to use an 'indicator' variable (indicator=0)
but I got the same result ("NULL").
For backward compatibility I need to execute a select as:
SELECT * FROM table WHERE my_field="";
sending to informix-list