SQLStatement external type

SQLStatement represents a dynamically prepared SQL statement. Instances of this type can be create only by using the Prepare statement.

EGL package name

eglx.persistence.sql

Example use
The following code prepares an SQL statement from a dynamically constructed string; opens a result set that is based on that SQL statement; and retrieves the retrieved string into a list.
// the data source is instantiated with a connection string.
connectURL string = "jdbc:derby:SomeDB;create=true;";
ds SQLDataSource = new SQLDataSource(connectURL);

// the SQL statement is instantiated later, by the prepare statement
sqlStatement SQLStatement?;

// the result set is instantiated later, by the open statement
rs SQLResultSet?;

statementString String = "Select name from ";

// assume that a function returns a table name at run time
statementString += getTableName();

// prepare the statement at run time
prepare sqlStatement from ds with statementString;

// open the result set
open rs from ds with sqlStatement;

// get the values
name string;
names string[];

foreach (name from rs)
   names.appendElement(name);
end
Type detail
externalType SQLStatement type NativeType
   private constructor();
end
Comments
Compatibility
Table 1. Compatibility
Target Issue
Java No issues.
JavaScript Database access is not supported.