Re: Is there an equivalent for "alter session set NLS_DATE_FORMAT = 'dd-mm-yyyy'" in Informix?
Posted in 2003
Mathias wrote: > does anybody know, if there exists an alternative for > > "alter session set NLS_DATE_FORMAT = 'dd-mm-yyyy'" > > in Informix? Directly - no. > We found this statement in an application which uses an Oracle-DB. Now > we have to modify this application so that a Informix-DB can be used. > Unfortunately this statement causes a syntax error, because Informix > doesn't know "alter session ...". > > To modity the environment variable DBDATE is not the solution we need, > because this has no effect when the database is already open. This > application offers the feature to modify the date-format within the > running applikation. OK - in that case fetch the dates into a C 4-byte integer instead of a string and format the string on the client side - there are formatting functions to do what you need documented in the ESQL/C manual. Or, if you are stuffing data into DATE columns, then you need to convert the string into a 4-byte integer before sending it to the server. Also, consider using the TO_CHAR or TO_DATE functions - they are similar to Oracle's functions and will work much the same job. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/