Progress
Embedded SQL-92
Guide and Reference


TIME Data Type

The TIME data type corresponds to the time value with four parts: hours, minutes, seconds, and milliseconds. The database representation is a long integer. The host language representation is equivalent to the following C Language structure:

typedef struct {
     unsigned char hours ;
     unsigned char mins ;
     unsigned char secs ;
     unsigned short msecs ;
} tpe_time_t ; 

The hours range is 0 to 23. The minutes range is 0 to 59. The range for the seconds part is 0 to 59. The milliseconds range is 0 to 999.

EXAMPLE

The following example shows how to use the TIME data type:

EXEC SQL BEGIN DECLARE SECTION ;
     TIME time_v ;
EXEC SQL END DECLARE SECTION ;
 
EXEC SQL
     SELECT arrival_time
     INTO :time_v
     FROM arrivals
     WHERE train_no = 230 ; 

Some of the scalar functions available for manipulating TIME data are TO_TIME, HOUR, MINUTE, SECOND, etc. See Chapter 4, “SQL-92 Functions,” in the Progress SQL-92 Guide and Reference for additional information on scalar functions.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095