Progress
Embedded SQL-92
Guide and Reference
Explicit Data Comparison Using tpe_compare_data( )
Use the SQL-92 API function tpe_compare_data to compare two data values of the same type. The syntax for tpe_compare_data is:
dtype
Data type of the two values that are being compared.
buf1len
Length of the buffer containing the first value.
buf
A pointer to the buffer containing the first value.
buf2len
Length of the buffer containing the second value.
buf2
A pointer to the buffer containing the second value.
result
An integer that points to a location for returning the result. Table 13–1 shows the range of integer values returned by the tpe_compare_data function into result.
dtype
Must be one of the data type symbolic names defined in
$DLC/include/sql_lib.h.
The defined symbolic names include:
The tpe_compare_data function returns a 0 if the compare operation succeeds. If the compare operation is not successful, the function returns a non-zero status code.
EXAMPLEThe following code fragment shows the comparison of two NUMERIC data elements. This example compares val1_v and val2_v and returns the result in the result_v variable:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |