Db2

 View Only

How to get a UTC Timestamp generated in a column during LOAD?

  • 1.  How to get a UTC Timestamp generated in a column during LOAD?

    IBM Champion
    Posted Tue July 21, 2020 11:09 AM

    How can I store a UTC Timestamp automatically in a column during a LOAD?

    So far I tried this (Db2 10.5. and 11.1)
    - Defining the column as NOT NULL WITH DEFAULT CURRENT TIMESTAMP - CURRENT TIMEZONE --> gives an SQL0104 Syntax error
    - Defining the column as GENERATED ALWAYS AS ( CURRENT TIMESTAMP - CURRENT TIMEZONE) --> does not work as special registers are not allowed in a GENERATED clause
    - Defining the column as GENERATED ALWAYS AS ( TIMESTAMP(GET_UNIQUE)) --> does not work as non-deterministic functions are not allowed in a GENERATED clause
    - A BEFORE Trigger is not an option as LOAD does not fire triggers

    Anyone any idea?

    TIA
    DB2Joe



    ------------------------------
    Joachim Klassen

    @Db2Joe
    ------------------------------

    #Db2