Xbasic

DataTransformExpression Example

Description

The SQL::DataTypeInfo.DataTransformExpression property is an Xbasic expression to be evaluated when retrieving data values from a SQL::ResultSet or a SQL::Row. The data is transformed each time the column is referenced using the SQL::ResultSet::Data() function.

The Xbasic expression can reference built-in variables named:

  • ColumnIndex as N

  • ColumnValue as A

in the same manner as NamedFormatExpressions.

Example 

dim c as sql::connection
? c.open("{A5API=Access,FileName='c:\northwind.mdb',UserName='Admin'}")
= .T.
? c.execute("select * from customers")
= .T.
c.resultset.columninfo[1].datatransformexpression = "\"\" + ColumnIndex + \" \" + ColumnValue"
? c.resultset.data(1)
= "1 ALFKI"

Limitations

Desktop applications only.