If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > current time in procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-30-03, 09:44
problems problems is offline
Registered User
 
Join Date: Oct 2003
Posts: 6
Angry 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
Reply With Quote
  #2 (permalink)  
Old 10-30-03, 12:35
pd12 pd12 is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 10-31-03, 12:18
fprose fprose is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 11-03-03, 10:31
problems problems is offline
Registered User
 
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 ???
Reply With Quote
  #5 (permalink)  
Old 11-03-03, 12:25
fprose fprose is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On