SetSort  SetSQLSelect

Chapter 9: Methods for the DataWindow Control

SetSQLPreview

Description

Specifies the SQL statement for a DataWindow control or DataStore that PocketBuilder is about to send to the database.

Syntax

integer dwcontrol.SetSQLPreview ( string sqlsyntax )

Argument

Description

dwcontrol

A reference to a DataWindow control, DataStore, or child DataWindow.

sqlsyntax

A string whose value is valid SQL syntax for the SQL statement that will be submitted to the database server.

Returns

Returns 1 if it succeeds and 0 if an error occurs. If any argument’s value is NULL, the method returns NULL.

Usage

Use SetSQLPreview to modify syntax before you update the database with changes in the DataWindow object.

To obtain the current SQL statement in the SQLPreview event, look at the sqlsyntax argument.

NoteWhen to call SetSQLPreview Call this method only in the script for the SQLPreview event.

Examples

Example 1

This statement sets the current SQL string for the DataWindow dw_1:

dw_1.SetSQLPreview( &

		"INSERT INTO billings VALUES(100, " + &

		String(Current_balance) + ")")

See also





Copyright © 2004. Sybase Inc. All rights reserved. SetSQLSelect

View this book as PDF