iTP Active Transaction Pages (iTP ATP) Programmer's Guide

ATP Objects, Properties, and Methods
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide522292-002
4-23
atp.sqlvar Object
atp.sqlvar Object
The atp.sqlvar object represents the detailed description of one column or variable
from a NonStop SQL query. Most applications do require this object. The object is
useful for applications that dynamically create the format (as well as the content) of
HTML pages based on an SQL query directly entered by an application user. Such
applications include decision-support applications, testing tools, and database
administration tools.
Constructor
new atp.sqlvar (atp.SQL_object, column/variable_index,
input/output_flag)
atp.SQL_object
This parameter is a previously instantiated object that represents one NonStop SQL
statement, typically a DML-style statement such as SELECT or INSERT. The
NonStop SQL statement could return columns and take variables as input. (A
variable is designated by a ? in the query).
column/variable_index
This parameter is the index of either a column or variable within the query. (The
next parameter, input_output_flag, indicates which.) For a column, the value
is the index of the atp.SQL object column_name array. For a variable, the value
is the index of the atp.SQL object variables array.
You could use this object to loop through the atp.SQL object column_name
array, instantiate an atp.sqlvar object for each index, and dynamically create
HTML based on the atp.sqlvar properties. For example, you could use the data
type to set the alignment in an HTML table of the data, or to lay out a form for input
of query variables. (The atp.sqlvar object indicates the data type of an object,
which has implications for the layout of an HTML table or form.)
input/output_flag
This parameter indicates whether the object represents input or output data. Its
permissible values are 0 and 1. Use 0 for information about output items (generally
columns). Use 1 for information about input items (variables). By default the value
is 0 (zero).