SQL Function

Returns the result of an SQL query.

SQL (Connection, SQL Statement)

Parameters

Connection  - a valid IBM i connection.

SQL Statement - a valid SQL query string.  

Use

The SQL function allows you to return the results of an SQL query. The function invokes a web service provided by OpenLook which allows us to run an SQL query on the host and return the results.

The SQL function is only supported in the following control properties:

If an SQL function is used to set a property that does not support this function, an empty string will be returned by the function.

BE AWARE THAT:

This function can only be used to query files on host machines with a current Openlook installation.

Return Value

A data source object.

Examples

Function

Returns

SQL("HOST", "SELECT * FROM LOOKOADEMO/STOCKLVL")

Connect to Host and return data from all the columns of LOOKOADEMO/STOCKLVL

SQL("HOST", "SELECT PRODREF FROM LOOKOADEMO/STOCKLVL WHERE STOCKQTY < 10")

Connect to Host and return all values from the PRODREF column of LOOKOADEMO/STOCKLVL that are greater than 10.

SQL("HOST", "SELECT PRODREF, STOCKQTY FROM LOOKOADEMO/STOCKLVL LIMIT 3")

Connect to Host and return the PRODREF and STOCKQTY columns of LOOKOADEMO/STOCKLVL - limit the data to the first 3 records.

Relates to

Please note that these functions are specifically for use in the Macro Editor and Designer. The SQL function is not supported in the script editor.

See Also

ComboBox control | GoogleBarChart control | GooglePieChart control | ListBox control


© 2004-2021 looksoftware. All rights reserved.