IRISLIB database
SQL Class Reference
Inheritance diagram for SQL:
Collaboration diagram for SQL:

Private Member Functions

_.Library.RegisteredObject ConstructClone (_.Library.Boolean deep, _.Library.String cloned, _.Library.String location)
 
_.Library.Status NormalizeObject ()
 Normalizes all of an object's property values by invoking the data type Normalize methods. More...
 

Static Private Member Functions

_.ResultSet.SQL Prepare (_.Library.String sqlStatement, _.SYSTEM.Error returnError, _, _.Library.RawString importPackages, _, args)
 Prepare() More...
 
_.ResultSet.MetaData PrepareMetaData (_.Library.String txtSQL, _.SYSTEM.Error returnError, _.Library.RawString importPackages)
 

Additional Inherited Members

- Public Member Functions inherited from IResultSet
_.Library.Status CloseCursor ()
 This method is expected to be overridden by concrete subclasses.
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

This class has been superseded. It will remain for compatibility with existing code and samples. We recommend using <class>SQL.Statement</class>.

Cached ResultSet based on an SQL statement. This class only supports the SELECT statement.

Member Function Documentation

◆ ConstructClone()

_.Library.RegisteredObject ConstructClone ( _.Library.Boolean  deep,
_.Library.String  cloned,
_.Library.String  location 
)
private

This class has been superseded. It will remain for compatibility with existing code and samples. We recommend using <class>SQL.Statement</class>.

Cached ResultSet based on an SQL statement. This class only supports the SELECT statement.

◆ NormalizeObject()

_.Library.Status NormalizeObject ( )
private

Normalizes all of an object's property values by invoking the data type Normalize methods.

Many data types may allow many different representations of the same value. 
Normalization converts a value to its cannonical, or <em>normalized</em>, form.

Reimplemented from RegisteredObject.

◆ Prepare()

_.ResultSet.SQL Prepare ( _.Library.String  sqlStatement,
_.SYSTEM.Error  returnError,
  _,
_.Library.RawString  importPackages,
  _,
  args 
)
staticprivate

Prepare()

This method is different for each type of result set class. This method has two tasks. First, instantiate the correct
concrete result set class. For %ResultSet.SQL that means accepting the sql query text in the first parameter and
looking up the query implementation in the query cache. The second task is to prepare the resulting object for data
retrieval by the caller which is done in %OnNew. The assumption is that if the query requires any parameters
then the actual arguments are all literal or public variables.</p>

<p>For %ResultSet.SQL, the arguments are:
<table cols=2>
<tr><td width="20%" valign="top"><var>sqlStatement (byref)</var></td><td width="50%" valign="top">the SQL Select statement, either as a counted array or as a $$$NL delimited string;</td></tr>
<tr><td width="20%" valign="top"><var>returnError (byref)</var></td><td width="20%" valign="top">if an error occurs, this will be an oref of an instance of %SYSTEM.Error. That object has
a Status property as well as methods to convert that status value into message id's and text
from other error domains. If no error is detected during %Prepare then returnError is $$$NULLOREF;</td>
<tr><td width="20%" valign="top"><var>%importPackages</var></td><td width="20%" valign="top">this is a $list of package names to be used to resolve any unqualified names in the SELECT statement.<br>
For example, SELECT %ID from MyTable<br>If %importPackages contains "Sample" then the schema associated with the Sample package would be used
to qualify MyTable.</td></tr>
<tr><td width="20%" valign="top"><var>%args...</var></td><td width="20%" valign="top">variable number of argument values that correspond to '?' parameters contained in the sqlStatement.</td></tr>
</table></p>
<p>This method returns an instance of %Library.IResultSet in the generic case. In the case of %ResultSet.SQL, an instance of %ResultSet.SQL is returned.
<p>This method constructs a SaveSet containing objects that are part of the current %Save() for
persistent classes or %GetSwizzleObject for serial classes. A queue of objects to be saved or
serialized is also constructed. Only modified objects are included in the save queue. The value
(OID or serial value in OID form) of each object is also placed in the SaveSet.</p>

◆ PrepareMetaData()

_.ResultSet.MetaData PrepareMetaData ( _.Library.String  txtSQL,
_.SYSTEM.Error  returnError,
_.Library.RawString  importPackages 
)
staticprivate

PrepareMetaData is similar to Prepare except that no result set is instantiated. This

method returns a ResultSet.MetaData object. Be aware that the implementation of this method might cause the result set to be instantiated but that is up to the result set class itself and no result set is actually returned by this method - only metadata.


queryThis is the SQL SELECT statement
returnErrorIf an error occurs this is returned by reference and is a SYSTEM.Error object with properties set to describe information about the error. returnError.Status contains the Status value.
importPackagesThis is a comma delimited list of packages to import. This is only relevant if the result set implementation is generated and the query source might include unqualified names. The import packages list is used to resolve package/schema names for unqualified names.