Xbasic

SQL::InsertStatement::GenerateNativeSyntax Function

Syntax

SQL_Statement as C = <SQL::InsertStatement>.GenerateNativeSyntax([SQLConnection as SQL::Connection | SQLConnectionString as C])

Arguments

SQL_Statement

The native SQL equivalent of a Portable SQL expression.

<SQL::InsertStatement>

A SQL::InsertStatement object.

SQLConnection

Optional. A SQL::Connection object created with a DIM statement and 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::InsertStatement.SQLStatement property.

Example

dim conn as SQL::Connection
dim connString as C
dim ins as SQL::InsertStatement
dim sql_insert as C
connString = "{A5API='Access', FileName='c:\program files\a5v7\mdbfiles\alphasports.mdb'}"
sql_insert = "insert into customer (firstname, lastname, bill_city, bill_postal_code, bill_state_region) values ('George', 'Jones', 'Arlington', '02000', 'VA')"
? conn.open(connString)
= .T.
? ins.parse(sql_insert)
= .T.
? ins.GenerateNativeSyntax(conn)
= "INSERT INTO customer(firstname, lastname, bill_city, bill_postal_code, bill_state_region) VALUES ('George', 'Jones', 'Arlington', '02000', 'VA')"

See Also