Db2

Db2

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  How to convert bigint to timestamp in IDMC?

    Posted Thu March 30, 2023 09:22 AM

    When the following query is executed in IDMC, the result is as follows.

    [idmc@idmc ~]$ db2 " select collected,CONNECTION_START_TIME
    from IBMCONSOLE.\"sessions\"
    where dbconn_int = 2
    and application_handle = 108
    order by collected limit 3"

    COLLECTED                  CONNECTION_START_TIME
    -------------------------- ---------------------
    2023-03-05-14.14.01.882000         1678025640876
    2023-03-22-15.04.16.667000         1679497456585
    2023-03-30-09.10.56.480000         1680167372275

      3 record(s) selected.

    Could you please let me know how to check CONNECTION_START_TIME in timestamp format from the above results?

    Thank you.



    ------------------------------
    JH Kim
    ------------------------------


  • 2.  RE: How to convert bigint to timestamp in IDMC?

    Posted Thu March 30, 2023 10:40 AM

    You can try to use the formula described in DMC manual at:

    https://www.ibm.com/docs/en/db2-data-mgr-console/3.1.x?topic=support-changing-date-format-in-excel-reports

    I hope that helps!



    ------------------------------
    Cintia Ogura
    ------------------------------



  • 3.  RE: How to convert bigint to timestamp in IDMC?

    Posted Thu March 30, 2023 09:29 PM

    Thank you for your response.
    As you mentioned, when I put the formula in Excel and run it,
    the timestamp result appears correctly.
    However, I want to analyze it at the query level.
    Is there a way to directly convert it to a query?

    Thank you.



    ------------------------------
    JH Kim
    ------------------------------



  • 4.  RE: How to convert bigint to timestamp in IDMC?

    Posted Fri March 31, 2023 07:13 AM

    Using value from your first line of example:

    C:\Users\JanNelken>db2 values timestamp('1970-01-01') + (1678025640876 /1000) seconds

    1
    --------------------------
    2023-03-05-14.14.00.000000

      1 record(s) selected.



    ------------------------------
    Jan Nelken
    ------------------------------



  • 5.  RE: How to convert bigint to timestamp in IDMC?

    Posted Fri March 31, 2023 08:16 AM

    The answer was very helpful in analyzing the issue.

    Thank you for your response.



    ------------------------------
    JH Kim
    ------------------------------