iTP Active Transaction Pages (iTP ATP) Programmer's Guide
ATP Objects, Properties, and Methods
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide—522292-002
4-16
NonStop SQL Objects
NonStop SQL Objects
NonStop SQL objects enable you to develop scripts that use NonStop SQL databases.
For a discussion and example of using these objects, see Using NonStop SQL from
JavaScript on page 3-4.
atp.SQL Object
The atp.SQL object represents one NonStop SQL statement, including any derived
cursors, result data, and error reporting information. You can use atp.transaction
objects with the atp.SQL object for transaction protection.
Constructor
new atp.SQL (statement)
statement
This parameter contains any statement supported by dynamic NonStop SQL. The
only statements excluded are some related specifically to imbedded SQL or the
underlying implementation of dynamic SQL.
The atp.SQL object caches SQL statements to ensure good performance. The
cache is much more effective if the NonStop SQL statements are parameterized,
with variable data provided in the atp.SQL execute() method call.
See atp.SQL Object Usage Considerations
below.
Properties
statement (read-only)
This property contains the statement specified in the constructor.
column_name (read-only)
This array contains the column name of each column that will be returned by a
SELECT statement. Summary columns, such as COUNT(*) have a zero length
column_name array element. Subscripts are numeric; the range is from zero to the
number of columns in the query.
column_value (read-only)
This array contains the column value, as a string, of each column returned by a
SELECT statement. The atp.SQL next() method puts one row at a time into
this property. SQL null is represented by the JavaScript null value. Subscripts are
numeric or text (lowercase) in the form tablename.colname (for example,
stmt.column_value["cust.first_name"]). As in other JavaScript
implementations, references to undefined array elements (such as misspelled column
names) are not reported as errors. The value is returned as the JavaScript undefined
value.