Database Engines:odbc

Which data types are present in a table? Professional

The data types that are actually present in a table when it is opened in a work area can be retrieved using the DbInfo() function and passing to it the constant ODBCDBO_ODBC_TO_XPP from the ODBCDBE.CH file:

USE Customer 

aTypes := DbInfo( ODBCDBO_ODBC_TO_XPP ) 

ASort( aTypes,,, {|a1,a2| a1[1] < a2[1] } ) 

? "DBMS-type => DDL-type" 
AEval( aTypes, {|a| QOut( a[1], "=>", a[2] ) } ) 

The resulting output of this code can look as follows when the table is managed by MS SQL Server (refer to Data type mapping for an explanation of DDL-types and DBMS-types).

DBMS-type => DDL-type 

bit => L 
char => C 
numeric => N 
text => M 

The Customer table used for this example has more than four columns, but only four different data types are used in the table.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.