ODBCDatabase.GetSQLTypeInfo

From Xojo Documentation

Method

ODBCDatabase.GetSQLTypeInfo(DataType as Integer) As RecordSet

Supported for all project types and targets.

Returns a RecordSet containing information about data types supported by the data source.

Notes

The DataType specifies the type for which the information should be returned.

Use ODBCConstant values for the data types.

To return a RecordSet containing all defined types, specify ODBCConstant.SQL_ALL_TYPES.

The returned RecordSet typically contains these columns, but they could vary depending on the driver being used:

  • Data Type Name
  • Data Type integer value
  • Column size

References

SQLGetTypeInfo ODBC function

Example

Displays all the supported data types for the current ODBC connection in a ListBox:

Var db As New ODBCDatabase

db.DataSource = "TeamExample"

Try
db.Connect

Var rs As RowSet
rs = db.GetSQLTypeInfo(ODBCConstant.SQL_ALL_TYPES)

While Not rs.AfterLastRow
ListBox1.AddRow(rs.ColumnAt(1).StringValue)
rs.MoveNext
Wend

Catch error As DatabaseException
MessageBox("Error: " + error.Message)
End Try