Professional Web Applications Themes

date/time/timestamp data - IBM DB2

Hello Gurus, I have this timestamp data "5-22-2003 18:05:09" that I need to insert into a DB2 database but I can't seem to get it to work no matter what kind of formatting I tried. The table I have created just to test is of the form: create table datetbl(timestmp1 timestamp) I thought of using varchar to make everything easy but I need to do searches and such based on date/time of event, so i definitely need something other than varchar. And thought that timestamp would be best. But I can't seem to figure out how to enter data such ...

  1. #1

    Default date/time/timestamp data

    Hello Gurus,

    I have this timestamp data "5-22-2003 18:05:09" that I need to insert
    into a DB2 database but I can't seem to get it to work no matter what
    kind of formatting I tried.

    The table I have created just to test is of the form:
    create table datetbl(timestmp1 timestamp)

    I thought of using varchar to make everything easy but I need to do
    searches and such based on date/time of event, so i definitely need
    something other than varchar. And thought that timestamp would be
    best. But I can't seem to figure out how to enter data such as above.
    Could someone please help. TIA
    Kenjis Kaan Guest

  2. #2

    Default Re: date/time/timestamp data

    Kenjis Kaan wrote:
    > Hello Gurus,
    >
    > I have this timestamp data "5-22-2003 18:05:09" that I need to insert
    > into a DB2 database but I can't seem to get it to work no matter what
    > kind of formatting I tried.
    >
    > The table I have created just to test is of the form:
    > create table datetbl(timestmp1 timestamp)
    >
    > I thought of using varchar to make everything easy but I need to do
    > searches and such based on date/time of event, so i definitely need
    > something other than varchar. And thought that timestamp would be
    > best. But I can't seem to figure out how to enter data such as above.
    > Could someone please help. TIA
    2003-05-22-18.05.09.000000

    W Gemini Guest

  3. #3

    Default Re: date/time/timestamp data

    IBM has a good article, Fun with Timestamps...or something like that.
    Here's a link, check it out....

    [url]http://www7b.software.ibm.com/dmdd/library/techarticle/0211yip/0211yip3.html[/url]

    One of IBM's biggest problems seems to be that their doentation isn't
    well organized. It's always hard to find what I'm looking for.

    "Rhino" <rhino1NOSPAM.sympatico.ca> wrote in message
    news:aNvVa.2905$537.479790news20.bellglobal.com.. .
    > Just to clarify W Gemini's terse reply, DB2 expects timestamps to be in
    the
    > format: year-month-day-hour.minute.second.microsecond. You were trying to
    > express the timestamp as month, followed by day, followed by year, etc. If
    > you express your timestamp as shown by W Gemini, you should have no
    problem
    > with your insert.
    >
    > Rhino
    >
    > "W Gemini" <wgemininowhere.com> wrote in message
    > news:1dhVa.1353$Cx4.319370news20.bellglobal.com.. .
    > > Kenjis Kaan wrote:
    > > > Hello Gurus,
    > > >
    > > > I have this timestamp data "5-22-2003 18:05:09" that I need to insert
    > > > into a DB2 database but I can't seem to get it to work no matter what
    > > > kind of formatting I tried.
    > > >
    > > > The table I have created just to test is of the form:
    > > > create table datetbl(timestmp1 timestamp)
    > > >
    > > > I thought of using varchar to make everything easy but I need to do
    > > > searches and such based on date/time of event, so i definitely need
    > > > something other than varchar. And thought that timestamp would be
    > > > best. But I can't seem to figure out how to enter data such as above.
    > > > Could someone please help. TIA
    > >
    > > 2003-05-22-18.05.09.000000
    > >
    >
    >

    Brien Schultz Guest

Similar Threads

  1. Inserting both date AND time into one timestamp column
    By orionMX in forum Coldfusion Database Access
    Replies: 3
    Last Post: October 29th, 05:34 PM
  2. Replies: 1
    Last Post: October 24th, 11:38 AM
  3. timestamp to date ?
    By Damian John Paul Brown in forum PHP Development
    Replies: 3
    Last Post: April 11th, 07:31 AM
  4. Date/Time and TIMESTAMP
    By guiksye webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 2
    Last Post: July 17th, 03:51 PM
  5. timestamp with no date, ideas welcome
    By The_Duck in forum Sun Solaris
    Replies: 0
    Last Post: July 9th, 02:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139