Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005
    Prague, Czech Republic

    Unanswered: Trigger - string to datetime conversion

    Hi all,

    I have character(16) column in the format : cyymmddhhmmssttt where:
    c = century (1 = 21st century)
    yymmdd = year, month, day
    hhmmssttt = hours, minutes, seconds, milliseconds

    And i would like to write a trigger which will fill date and time columns with the appropriate values derived from the string.

    Can someone help me how to build the trigger which will cut the input string and fill the data into the columns ???

    Thank you in advance ...


  2. #2
    Join Date
    Nov 2004


    you will have to work with substr
    insert into ..... values (substr(oldcol,2,2)||'-'||substr(oldcol,4,2)||'-'.......
    Best Regards, Guy Przytula
    DB2/ORA/SQL Services
    DB2 DBA & Advanced DBA Certified
    DB2 Dprop Certified

Posting Permissions

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