Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Posts
    6

    Angry Unanswered: current time in procedure

    Hi,
    i want to put a lot of trace (log time in a table) in some procedure. The function "current" show the same time by statement. How can i get the real current time in a procedure ?

    please help me

  2. #2
    Join Date
    Sep 2003
    Posts
    22
    hello,

    Couple of ways,

    select first 1 current from tabname.

    have this as dummy table with 1 row, or any table with minimum no. of rows.

    second, write a 1 line .sh file with a line
    date

    it gives the system time for you.


    -PD

  3. #3
    Join Date
    Apr 2003
    Location
    Phoenix, AZ
    Posts
    177
    The timestamp you will retrieve is the timestamp when you first entered the stored procedure - it doesn't change while in the SP.

    That being said, you have to query the OS for the current time.
    Fred Prose

  4. #4
    Join Date
    Oct 2003
    Posts
    6

    Question how can i get the OS current time

    But, how can i get the OS time in an informix function ???

  5. #5
    Join Date
    Apr 2003
    Location
    Phoenix, AZ
    Posts
    177

    Re: how can i get the OS current time

    This works in 9.x

    create function fn_getcurrtime() returns datetime year to second
    define cur_time datetime year to second;
    select DBINFO('utc_to_datetime',sh_curtime)
    into cur_time
    from sysmaster:sysshmvals;
    return cur_time ;
    end function ;
    Fred Prose

Posting Permissions

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