× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



rob@xxxxxxxxx wrote:
Love to see the exact message you received on both:
- the FOR READ ONLY
- UNION not availble.
Please include message id.

On closer examination, it looks like the UNION part is within a given embedded SELECT, rather than between multiple SELECTs.

At any rate, this programmatically-generated statement:

    INSERT INTO QTEMP/WTGRPW SELECT CID FROM WTCONT CO
    WHERE CO.U01010 = '1' FOR READ ONLY WITH NC

produced this error message:

    FOR FETCH ONLY clause not allowed.

with this help-text:

Message ID . . . . . . : SQL0109 Severity . . . . . . . : 30
Message type . . . . . :   Diagnostic
Date sent . . . . . . : 11/11/05 Time sent . . . . . . : 11:31:43

Message . . . . :   FOR FETCH ONLY clause not allowed.
Cause . . . . . : One of the following conditions was not allowed: -- Embedded SELECT statements cannot include the FOR UPDATE clause, the FOR READ ONLY clause, the FOR FETCH ONLY clause, the OPTIMIZE clause, or the
  UNION or UNION ALL operator.
-- SELECT statement used in cursor declarations or subselects cannot have
  an INTO clause.
-- CREATE VIEW statements may not have an INTO, ORDER BY, FOR UPDATE, FOR
  READ ONLY, FOR FETCH ONLY, or OPTIMIZE clause.
-- INSERT statements may not have an INTO clause in a subselect, a FOR UPDATE, FOR READ ONLY, FOR FETCH ONLY, or an OPTIMIZE clause. -- WHERE CURRENT OF cursor clause is not allowed in statements processed in interactive SQL or statements processed by the RUNSQLSTM command. -- The NOT NULL clause is not allowed in the definition of a column being
  added to a table unless a default value is specified.
Recovery . . . : Remove the clause. A cursor may be needed to perform the
  processing.
-- The FOR UPDATE, FOR READ ONLY, FOR FETCH ONLY, and OPTIMIZE clauses are
  accepted in the DECLARE CURSOR statement.
-- The UNION or UNION ALL operators are accepted in the DECLARE CURSOR and
  INSERT statements.
-- The INTO clause is accepted in the FETCH and embedded SELECT
  statements.
-- The ORDER BY clause is allowed on the DECLARE CURSOR, embedded SELECT,
  and the INSERT statements.
-- The WHERE CURRENT OF cursor clause is valid in an embedded or dynamic
  SQL statement.
-- Remove the NOT NULL clause from the column definition or specify a
  default value for the column.
    Try the request again.

--
JHHL

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.