run-time DBDATE in ESQL/C SELECT
Posted in 2001
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hello! Is it possible to read the date as Y4MD on the fly in ESQL/C, if you have DBDATE set to DMY4. or to some other unknown value? Regards, Roman
Roman Maurer wrote: > Is it possible to read the date as Y4MD on the fly in ESQL/C, if you > have DBDATE set to DMY4. or to some other unknown value? Select the data into an 'int' or 'int4' data variable, instead of a string. Then use the rfmtdate() function to format it: "dd.mm.yyyy" or thereabouts as the format string. Also check out the code in datefmt.c in SQLCMD from the IIUG software archives -- there's a function in there that takes a DBDATE string and generates the value needed by rfmtdate(). It is currently a file static function which means I don't use it directly but only via an interface function that gets the value of $DBDATE and then formats that. -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"