Considerations For Select; Authorization Requirements; Locking Modes; Use Of Views With Select - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

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.

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.
Locking modes are relevant only to select operations that use a cursor. In a standalone SELECT
statement, locks are maintained only for the duration of the select.

Use of Views With SELECT

When a view is referenced in a SELECT statement, the specification that defines the view is
combined with the statement. The combination can cause the SELECT statement to be invalid.
If you receive an error message that indicates a problem but the SELECT statement seems to be
valid, check the view definition.
For example, suppose that the view named AVESAL includes column A defined as AVG (X).
The SELECT statement that contains MAX (A) in its select list is invalid because the select list
actually contains MAX (AVG (X)), and an aggregate function cannot have an argument that
includes another aggregate function.
154).
SELECT Statement
151

Advertisement

Table of Contents
loading

Table of Contents