SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

Introduction
HP NonStop SQL/MX Reference Manual523725-004
1-28
Accessing Views
NCHAR Data
You can select NCHAR columns from SQL/MP tables. See NCHAR Columns in
SQL/MP Tables on page 6-23.
You can insert into or update NCHAR columns in SQL/MP tables only when the
NCHAR data being written to the table contains an even number of bytes. A string
literal you use this way can be specified:
N'string'
N associates the default character set with the string literal. The default is set by the
value of the NATIONAL_CHARSET attribute. See Inserting Into or Updating SQL/MP
NCHAR Columns on page 6-64.
NonStop SQL/MX operates on NCHAR data as if it were a single-byte character string
of twice the specified length, not as a double-byte character string. As a result, the
LIKE predicate and most character functions (INSERT, LEFT, LOCATE, LPAD, LTRIM,
POSITION, REPLACE, RIGHT, RPAD, RTRIM, SUBSTRING, TRIM) do not give
correct results.
However, because the HP NonStop operating system architecture is big-endian,
ordering (ORDER BY and the comparison predicates) works correctly. The order is the
same whether you view the data as a double-byte or a single-byte character stream.
Accessing Views
The FOR PROTECTION clause of the SQL/MP CREATE VIEW statement specifies a
protection view. If you omit this clause, the view is a shorthand view.
NonStop SQL/MX provides support for the access of SQL/MP protection views. A
protection view is derived from a single table and has associated security values that
determine who can read, write to, execute, and purge the view. Security specifically
defined on the view overrides the security on the underlying table.
NonStop SQL/MX also supports the read-only access of SQL/MP shorthand views. A
shorthand view is derived from one or more tables or other views and inherits the
security of the underlying table or tables.
Access Options
If your SQL/MP application uses the BROWSE, STABLE, and REPEATABLE
keywords, NonStop SQL/MX accepts these keywords as synonyms for statement-level
access options READ UNCOMMITTED, STABLE, and SERIALIZABLE (or
REPEATABLE READ), respectively.