HP Neoview SQL Reference Manual page 174

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

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.
Join Limits
NOTE:
HP recommends that you limit the number of tables in a join to a maximum of 64, which
includes base tables of views referenced in joins. Queries with joins that involve a larger number
of tables are not guaranteed to compile.
Object Names in SELECT
You can use fully qualified names only in the FROM clause of a SELECT statement.
AS and ORDER BY Conflicts
When you use the AS verb to rename a column in a SELECT statement, and the ORDER BY
clause uses the original column name, the query fails. If a column has been aliased to another
name, you must use the alias name. The ANSI standard does not support this type of query.
Stream Access Restrictions
SELECT statements can access only one table with stream access, except for unions that
allow both SELECT statements to use stream access. However, you must use UNION ALL
when using stream access with unions.
You cannot join two streams.
Aggregate functions are not supported on streams and, therefore, no GROUP BY or HAVING
clauses are valid on streams.
Sort operations are not supported on streams. Therefore, you cannot use DISTINCT, UNION
DISTINCT, or ORDER BY unless supported by an index. You can use a secondary index for
accessing an ordered stream only if the columns in the index definition include all the
columns of the base table accessed as a stream that are referenced in its WHERE clause.
A query expression that serves as a data source for an INSERT statement cannot specify
stream access.
A DELETE or UPDATE statement that is not embedded as a table reference cannot specify
stream access. For example, the statement DELETE FROM STREAM(tab1) is not valid.
If your application must handle a fast rate of publishing into the stream, or publishes rows
in very large transactions, it must be able to handle stream overflows.
Restrictions on Embedded Inserts
You cannot create materialized views using an embedded INSERT statement.
An embedded INSERT cannot be used in a join.
An embedded INSERT cannot appear in a subquery.
An embedded INSERT statement cannot have a subquery in the WHERE clause.
An INSERT statement cannot contain an embedded INSERT statement.
174
SQL Statements

Advertisement

Table of Contents
loading

Table of Contents