Re: Help: using DBTIME to load different time formats
Posted in 1998
On Thu, 15 Oct 1998, Vardan Aroustamian wrote:
> David Buttrick <buttrick@sportingnews.com> wrote:
> > I am running Informix SE 7.24UC5 on Linux...
> >
> > I have a time stamp in a load file which looks like this:
> > 07:30:00PM
> >
> > Currently, we alter this using perl to represent a correct timestamp.
> > I'd like to set the DBTIME environment to load this time stamp format.
> > [...] Setting the DBTIME env this way: DBTIME=%I:%M:%S%p; export DBTIME
> > [...] I still get an error about illegal characters in datetime string.
> >
> > According to Informix, this should work.
>
> DBTIME environment variable is intended to use with SQL API only.
> E.g. in functions dtcvfmtasc(), dttofmtasc() in ESQL/C.
> It will not work with dbload or load.
Vardan is correct.
If you go to the IIUG web site, you should find a program dbldfmt version 3.9
in the administration tools section which deals with datetime format conversions
by allowing you to specify the input format for strptime(3) and the output format
for strftime(3) functions. It can also do a lot of other cleanup work. It is,
however, designed to deal with fixed format input, not variable length delimited
fields -- that may present some problems.
My current version of dbldfmt is 3.13, and I need to get that to the IIUG archive
since there's a significant bug with calculating the lengths of the buffers in the
earlier version... I won't post that to c.d.i; it's a bit big.
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