SetSQLPreview method (DataWindows)
Description
Specifies the SQL statement
for a DataWindow control or DataStore that PowerBuilder is about
to send to the database.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>SetSQLPreview</span> ( string <span>sqlsyntax </span>) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>SetSQLPreview</span> ( string <span>sqlsyntax</span> ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, |
sqlsyntax |
A string whose value is valid SQL syntax for the SQL statement that will be submitted |
Return Values
Returns 1 if it succeeds and 0 if an error occurs. If any
argument’s value is null, in PowerBuilder and JavaScript
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.
Call this method only in the script for the SQLPreview event.
Examples
This statement sets the current SQL string
for the DataWindow dw_1:
1 |
dw_1.<span>SetSQLPreview</span>( & |
1 |
"INSERT INTO billings VALUES(100, " + & |
1 |
String(Current_balance) + ")") |