Gpre Migration Issues
SQLDA
6.0 gpre will only support XSQLDA structures. The support for old style SQLDA is removed. This means that old gpre applications that used SQLDA has to be re-written using XSQLDA. The three main steps involved in doing this are:
Replace SQLDA with XSQLDA in variable definitions.
i.e. SQLDA *input, *output; will become XSQLDA *input, *output
Use XSQLDA_LENGTH macro to calculate the XSQLDA variable's length.
i.e. input=(XSQLDA*) malloc (XSQLDA_LENGTH(4));
Set the sqlda version as 1
i.e. input->version=SQLDA_VERSION1;
SQL Date, Time, Timestamp
InterBase 6.0 gpre allows the user to exploit the new datatype i.e. date, time, timestamp present in 6.0 server. This also means that in order to support backward compatability gpre would have to emit proper definitions, blr and dyn depending upon the database ods, server version and sql dialect when pre-processing a esql program file.
Metadata Statements
While creating tables, domains, procedures etc. gpre generates dyn based on the following criteria:
- if a column type is TIMESTAMP then irrespective of the database ods, server version, sql dialect gpre will generate dyn that represents timestamp.
- if a column type is TIME then gpre will punt with error for ods <10 and server version < 6.0 irrespective of the dialect. For all other cases dyn that represents sql time will be generated.
- if a column type is DATE and the ods is < 10 and server version <=6.0 then gpre will generate:
- dyn that represents timestamp if the sql dialect is 1
- Error if the sql dialect is 2,3
- For all other cases i.e. ods is==10 and server==6.0 gpre will generate:
- dyn that represents timestamp if the sql dialect is 1
- Error if the sql dialect is 2
- dyn that represents sql date if the sql dialect is 3
Data Retrieval statements
While selecting, inserting etc. data, gpre will generate blr exactly as specified in the criteria above. blr_timestamp, blr_sql_date, blr_sql_time will be generated for column whose datatypes are TIMESTAMP(or DATE in dialect 1), DATE, TIME respectively.
For a variable that is declared as based on a table column, the following changes will be noted.
- A variable that is based on a timestamp column will be declared as ISC_TIMESTAMP variable.
- A variable that is based on a time column will be declared as ISC_TIME variable.
- A variable that is based on a date column will be declared as ISC_TIMESTAMP variable in dialect 1 or as ISC_DATE variable in dialect 3.
Note that earlier versions of gpre generated ISC_QUAD for variables based on date column type.