Considerations For Select - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

The select lists in the two SELECT statements of a union operation must have the same
number of columns, and columns in corresponding positions within the lists must have
compatible data types. The select lists must not be preceded by [ANY N] or [FIRST N].
The number of columns in the result table of the union operation is the same as the number
of columns in each select list. The column names in the result table of the union are the same
as the corresponding names in the select list of the left SELECT statement. A column resulting
from the union of expressions or constants has the name (EXPR).
See
"Considerations for UNION" (page
ORDER BY {colname | colnum} [ASC[ENDING] | DESC[ENDING]] [,{colname | colnum}
[ASC[ENDING] | DESC[ENDING]]]...
specifies the order in which to sort the rows of the final result table.
colname
names a column in select-list or a column in a table reference in the FROM clause
of the SELECT statement. colname is optionally qualified by a table, view, or correlation
name; for example, CUSTOMER.CITY. If a column has been aliased to another name you
must use the alias name.
colnum
specifies a column by its position in select-list. Use colnum to refer to unnamed
columns, such as derived columns.
ASC | DESC
specifies the sort order. The default is ASC. For ordering a result table on a column that
can contain null, nulls are considered equal to one another but greater than all other
nonnull values.
See
"Considerations for ORDER BY" (page

Considerations for SELECT

Authorization Requirements
SELECT requires authority to read all views and tables referred to in the statement, including
the underlying tables of views referred to in the statement.
Updating Rows
A SELECT with READ UNCOMMITTED ACCESS on a table whose primary key or unique index
key columns are being updated could catch the update operation in an intermediate stage, where
some or all of the affected rows have been deleted from the table but the altered rows have not
yet been inserted back into the table.
Locking Modes
When specifying the locking mode for a SELECT statement:
Use SHARE mode when the process reads data but does not modify it. Specifying READ
COMMITTED access and SHARE mode ensures a higher level of concurrency.
Use EXCLUSIVE mode when the process reads data and then modifies it with a delete or
update operation. Requesting exclusive locks on the SELECT prevents other processes from
acquiring share locks on the accessed rows between the time of the select and the time of
the subsequent delete or update. Such locks by other processes would prevent the process
from escalating its own share locks to the exclusive locks required for a delete or update
operation, causing the process to wait or timeout.
Do not specify the IN clause for READ UNCOMMITTED access. If you omit the IN clause
for other access options, SQL uses SHARE until an attempt is made to modify the data, and
then escalates the lock to EXCLUSIVE.
176).
176).
SELECT Statement
173

Advertisement

Table of Contents
loading

Table of Contents