Progress
Embedded SQL-92
Guide and Reference


Explicit Data Conversion Using SQL and syscalctable

You can also convert from one data type to another without using scalar functions in SQL-92 statements. The following example shows how to convert an INTEGER value to a DOUBLE PRECISION value, using the syscalctable system table:

EXEC SQL BEGIN DECLARE SECTION ;
     INTEGER qty_v ;
     DOUBLE double_val_v ;
EXEC SQL END DECLARE SECTION ;
 
EXEC SQL
     SELECT :qty_v
     INTO :double_val_v
     FROM sysprogress.syscalctable ; 

NOTE: When your application must be portable to another RDBMS, use SQL-92 statements for data type conversion in ESQL applications. When performance is the priority, use the SQL-92 API call tpe_conv_data to improve the performance of your application program.


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