Xbasic

SQL::Statement::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.

SQLConnection

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

SQLConnection

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::Statement.SQLStatement property.

Example

dim stat as SQL::Statement
dim connString as C
dim sql_delete as C
connString = "{A5API='Access', FileName='c:\program files\a5v7\mdbfiles\alphasports.mdb'}"
sql_delete = "DELETE FROM Customer_copy WHERE substring(lastname,1,1) = 'A'"
conn.open(connString)
stat.parse(sql_delete)
? stat.GenerateNativeSyntax(conn)
= "DELETE FROM Customer_copyWHERE (Mid(lastname, 1, 1) = 'A')"

See Also