02-27-2011 01:55 PM
Hello,
after executing:
..
Call SQL_Connect("abcDB","user","pw","") ' abcDB is a ODBC link to my Mysql 5 database
Call SQL_ExecDirect("SELECT id,temperature,tsdat FROM v$_header WHERE id < 1000")
..
>> the variable SQL_ColType(1..ColumnNo) shows me the datatypes of each column as a numerical value e.g.:
SQL_ColType(1) = 4
SQL_ColType(2) = -9
SQL_ColType(3) = 93
Which real database types are behind the values? It would be nice to get a complete list of all possible values?
Thank you.
Solved! Go to Solution.
02-28-2011 08:00 AM
Hi ddehn,
The SQL_...() commands are the old method for DIAdem to connect to SQL data bases, using the ODBC approach. Since DIAdem 10.2 the ADO approach is the recommended method. This is the function I used to use to makes sense of the SQL_ColType() values:
Function GetODBColTypes()
Dim j, jMax, ChTypes
jMax = SQL_ResultCols
IF jMax < 1 THEN jMax = 0
ReDim ChTypes(jMax)
FOR j = 1 TO jMax
IF SQL_ColType(j) = 93 THEN
ChTypes(j) = "DateTime"
ElseIF SQL_ColType(j) = -1 OR SQL_ColType(j) > 8 THEN ' STRING
ChTypes(j) = "String"
ELSE
ChTypes(j) = "Number"
END IF ' SQL_ColType(j)
NEXT ' j
GetODBColTypes = ChTypes
End Function ' GetODBColTypes()
Brad Turpin
DIAdem Product Support Engineer
National Instruments