Xbasic

SQL::Query::GenerateNativeSyntax Function

Syntax

SQL_Statement as C = GenerateNativeSyntax([SQLConnection as SQL::Connection | SQLConnectionString as C])

Arguments

SQL_Statement

The native SQL equivalent of a Portable SQL expression.

SQL::Query

A SQL::Query object created with a DIM statement.

SQLConnection

Optional. A SQL::Connection object with a defined .ConnectionString property.

SQLConnectionString

Optional. A connection string.

Description

Generate a native SQL statement using the selected syntax associated with the current or passed connection.

Discussion

The .GenerateNativeSyntax() method returns the native SQL version of the Portable SQL stored in the SQL::Query.SQLStatement property.

Example

dim qry as SQL::Query
dim conn as SQL::Connection
dim connString as C
connString = "{A5API='Access', FileName='c:\program files\a5v7\mdbfiles\alphasports.mdb'}"
? conn.open(connString)
= .T.
? qry.parse("Select * from Customer WHERE substring(lastname,1,1) = 'a'")
= .T.
? qry.GenerateNativeSyntax(connString)
= "SELECT * FROM CustomerWHERE (Mid(lastname, 1, 1) = 'a')"

See Also