Re: Embedded SQL and Converting SQLDTIME to ASCII
Posted in 1998
On Wed, 26 Aug 1998 tracy.kuhrt@altavista.net wrote: > I am trying to convert a SQLDTIME to an ascii string using Embedded SQL in C. > > I am initializing the sqldata pointers in the following manner: > [...long example based on code from ESQL/C manuals omitted...] > I have tried many different forms of setting the sqllen for the SQLDTIME > field, including: > > - rtypmsize(qSQLDA->sqlvar[i].sqltype, CDECIMALTYPE); > - sizeof(dtime_t); > - rtypmsize(qSQLDA->sqlvar[i].sqltype, 24); /* found this somewhere */ > - and, just leaving it as is (the default). Using sizeof(dtime_t) is correctest. I suggest you go to the IIUG web site (http://www.iiug.org) and download the SQLCMD program. You'll find a file describe.ec which deals with this, and I know it works. There is code in output.c to deal with the retrieved data. > I have tried [...more reasonable attempts omitted in the interests of brevity...] Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn PS: If you need more a more recent version of the code, contact me.