Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : LOCALTIME

LOCALTIME
Returns the local time when the transaction started. (F)
Invocation
now = LOCALTIME
 
now
On return, contains the current local time. Its syntax is C (fixed-length character string) with length 8.
Usage notes
LOCALTIME is typically used to notify the user of the local time a transaction is started.
Example
The set of rules in this example:
1.
2.
3.
The user sees the transaction start time in the local time and the system time is entered to the audit table.
Rule Using LOCALTIME:
USER_TIME schedules the TRANSACT rule and notifies the user with an ENDMSG:

 
USER_TIME;
_ ---------------------------------------------------------------------
_ ------------------------------------------------------------+--------
_ SCHEDULE TRANSACT; | 1
_ CALL ENDMSG(('TRANSACT SCHEDULED ') || LOCALTIME); | 2
_ ---------------------------------------------------------------------

 
The following ENDMSG is returned:
11:54:12 TRANSACT SCHEDULED 11:54:11
Definition of the TRANSACT Rule
TRANSACT calls in another rule and inserts the start and end time into the table AUDIT, using system time:

 
TRANSACT;
_ ------------------------------------------------------------+--------
_ CALL EMPLOYEE_DEPTNO; | 1
_ AUDIT.START = TIME; | 2
_ AUDIT.END = REALTIME; | 3
_ INSERT AUDIT; | 4
_ ---------------------------------------------------------------------

 
The following values are added to the sample table AUDIT:

 
TRANS_NUMBER START END
------------ -------- ---------
1 08:54:11 08:54:17

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved