ODBC Server Reference Manual

Transact-SQL Language
HP NonStop ODBC Server Reference Manualβ€”429151-002
4-61
NonStop ODBC Server Compared With
NonStop SQL/MP
In this example, both the VIEWS table and the EMPLIST view are in the subvolume
\TEST.$VOL2.PERSNL.
NonStop ODBC Server Compared With NonStop SQL/MP
The corresponding NonStop SQL/MP statement is CREATE VIEW.
When used through the NonStop ODBC Server, CREATE VIEW differs from the
NonStop SQL/MP implementation in the following ways:
DECLARE
Use DECLARE to declare the name and type of local variables for a batch. Assign
values to local variables with SELECT statements. You must use variables in the batch
in which they are declared.
Variables are described under Language Elements on page 4-5.
The DECLARE statement has the following syntax:
@variable-name
is the variable to declare. The variable-name must be preceded by a
commercial β€œat” sign (@).
data-type
is the SQL Server data type for the variable. Data types are treated as declared in
the NonStop ODBC Server; intermediate calculated results are performed with
NonStop SQL/MP data types, which can lead to slightly different arithmetic
truncation. Data types are described under Language Elements on page 4-5.
If you specify an unsupported data type, an error message is generated and the
statement is not executed.
Feature In NonStop SQL/MP
In Programs Used With the NonStop
ODBC Server
Where is the view
created?
In the user’s current
node, volume, and
subvolume
On the same subvolume as the
catalog in which the view is registered
Can you specify
protection view or
shorthand view?
Yes No, unless you use pass-through
mode.
Is WITH CHECK
OPTION available?
Yes No
DECLARE @variable-name data-type
[ , @variable-name data-type ] ...