GetSQLSelect – PB Docs 150

GetSQLSelect method (DataWindows)

Description

Reports the SQL SELECT statement
associated with a DataWindow if its data source is one that accesses
a SQL database (such as SQL Select, Quick Select,
or Query).

Controls

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore
object

Web ActiveX

DataWindow control, DataWindowChild object

Syntax

[PowerBuilder]

[Web ActiveX]

Argument

Description

dwcontrol

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

Return Values

Returns the current SQL SELECT statement
for dwcontrol. GetSQLSelect returns
the empty string (“”) if it cannot return the
statement.

If dwcontrol is null, the method returns
null.

Usage

When you want to change the SQL SELECT statement
for a DataWindow or DataStore at runtime, you can use GetSQLSelect to save the
current SELECT statement before making the change.

When you define a DataWindow, PowerBuilder stores a PowerBuilder SELECT statement
(PBSELECT) with the DataWindow. If a database
is connected and SetTransObject has been called for the DataWindow,
then GetSQLSelect returns
the SQL SELECT statement.
Otherwise, GetSQLSelect returns
the PBSELECT statement.

You can also use Describe to obtain the SQL SELECT statement.
The DataWindow object’s Table.Select property holds the
information.

Examples

The code saves the SELECT statement
for dw_emp in the variable old_select. Then it
adds a WHERE clause. The example assumes the
old SELECT statement did not have one already:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x