NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
P-24
Predicates
Predicates
A predicate is a statement involving a comparison that evaluates to a value of true, false,
or unknown (null). Use predicates within search conditions to specify criteria for
choosing rows from tables or views. SQL includes the following predicates:
BETWEEN Predicate
Comparison Predicate ( =, <>, <, >, <=, >= )
EXISTS Predicate
IN Predicate
LIKE Predicate
NULL Predicate
Quantified Predicate ( ALL, ANY, SOME )
For more information about a specific predicate, see the entry for that predicate.
PREPARE Statement
PREPARE is a dynamic SQL statement and an SQLCI command that compiles an SQL
statement for later execution with EXECUTE.
In host programs, PREPARE also returns information to the SQLSA that you can use to
declare an SQLDA for DESCRIBE and EXECUTE statements. (For details, see
INCLUDE SQLDA Directive
on page I-5 or the NonStop SQL/MP programming
manual for your host language.)
In SQLCI, you can use PREPARE to check syntax even if you don't intend to execute
the statement in the session. PREPARE also returns statistics about the compilation time.
{ stmt-name }
{ :stmt-name-var }
specifies a name to be used for the prepared statement. If you specify the name of an
existing prepared statement, the new statement overwrites the previous one.
stmt-name is an SQL identifier that is the name. You can use this form to specify
the name in programs or in SQLCI. In SQLCI, the name must be unique among
other statement and report item names in the SQLCI session.
:stmt-name-var is a host variable that contains an SQL identifier that is the
name. You can use this form to specify the name from programs. The variable must
be of a type compatible with SQL type CHAR or VARCHAR.
PREPARE { stmt-name } FROM { "stmt" | 'stmt' }
{ :stmt-name-var } { :stmt-var }