Syntax
SQLGetTypeInfo$(ConnectNum, Type$)
Remarks
Maps a known data type into an acceptable native data type. When using the SQL statements CREATE TABLE and ALTER TABLE, you must specify the data types native to that particular DBMS. To determine an appropriate data type for the DBMS you are using, you use the SQLGetTypeInfo$ function. For more information about data-type mapping for a given ODBC driver, see the corresponding Help file.
Argument | Explanation |
ConnectNum | The unique connection ID of the data source to which you want to map a known data type to a native data type. The connection ID is returned by a previously executed SQLOpen function. If ConnectNum is not valid, SQLGetTypeInfo$ returns an error value. |
Type$ | A data type for which you want to know the equivalent DBMS native data type. |
For any valid SQL data type, this function returns the corresponding data type
for the DBMS of the current data source.
Example
This example demonstrates how SQLGetTypeInfo$ can be used to make WordBasic ODBC macros portable to multiple DBMSs. Here, SQLGetTypeInfo$ stores native data types in variables; as a result, the SQL CREATE TABLE query specified in SQLExecQuery works regardless of the DBMS in which the data source was created.
int$ = SQLGetTypeInfo$(connect_num,"integer") txt$ = SQLGetTypeInfo$(connect_num,"text") ret = SQLExecQuery(connect_num, \ "create table emp_id(id " + int$ + ", name" + txt$ + "(32))")