Re: Entering a TimeStamp value into DB2

From: Hardy Merrill (HMerrill_at_dhcr.state.ny.us)
Date: 03/24/05


Date: Thu, 24 Mar 2005 07:19:07 -0500
To: <Richard.Rice@conti-na.com>,<dbi-users@perl.org>

Try googling next time for an answer to your question.

I went to google and searched for "db2 timestamp" and this
reference had some good info:

   http://www.craigsmullins.com/dbu_1200.htm

Here's a snippet:

Formatting

If formatting the date and time data is a major consideration for your
application then DATE and TIME may be a better solution. DB2 provides
formatting options for DATE and TIME columns via local DATE and TIME
exits. This means that you can specify a DB2 subsystem-wide default for
the way that date and time values should be displayed. Likewise the CHAR
function and DATE and TIME precompiler options exist for formatting DATE
and TIME data. If the date and time information is to be extracted and
displayed on a report or by an online application, the availability of
these DB2-provided facilities for DATE and TIME columns should be
considered when making your decision.

These facilities are not available for TIMESTAMP columns. There is a
single format for a timestamp value in DB2, and it looks like the sample
shown previously. A timestamp value always begins with the date
component, in the format YYYY-MM-DD combined using a hyphen ("-") to the
time component in the format:

       hh.mm.ss.zzzzzz.

HTH.

Hardy Merrill

>>> <Richard.Rice@conti-na.com> 03/23/05 11:21 PM >>>

I am having a problem using the Perl DBD::DB2 module to enter a
'TimeStamp'
value into a DB2 table. I have been able to write a perl script which
can
enter an 'integer' or 'varchar' value into a DB2 table. I also need to
enter a 'TimeStamp' value into the same table. I have not been able to
correctly format the 'TimeStamp' value in my script so that the
'INSERT'
command executes without errors.

Does anyone have a perl example script for entering 'TimeStamp' values
into
a DB2 table?

*****************************************
Richard Rice
Continental Tire North America, Inc.
(704) 583-8668
*****************************************



Relevant Pages

  • RE: errors reading linked table when row contains Timestamp
    ... in his reply that you can round the DB2 values to the nearest millisecond ... Microsoft Online Partner Support ... errors reading linked table when row contains Timestamp ... | I resorted to posting here, and read all about the CLI Configuration ...
    (microsoft.public.access.conversion)
  • Windows Scripting - Timestamp, files, need help. :)
    ... I need to write a script in vbscript (I want to use ... Gets the Highest (most recent timestamp) and compares it to the current ... and formatting it YYYYMMDDHHMM ... formatting each item in the array into the format YYYYMMDDHHMM ...
    (microsoft.public.scripting.vbscript)
  • Entering a TimeStamp value into DB2
    ... I have been able to write a perl script which can ... enter an 'integer' or 'varchar' value into a DB2 table. ... enter a 'TimeStamp' value into the same table. ...
    (perl.dbi.users)
  • RE: errors reading linked table when row contains Timestamp
    ... wish to talk with your DB2 representatives to ensure these have already ... That site describes the issue and recommends the following configuration ... workaround for Microsoft Access applications. ... errors reading linked table when row contains Timestamp ...
    (microsoft.public.access.conversion)
  • an approach
    ... i am working on db2 and need a perl script to delete data from a ... There is a column in that table X lets say Xdate. ... timestamp format so its creating problems for me. ... db2 "select countfrom tableX" into a variable say $DD... ...
    (comp.lang.perl.misc)