× 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.



IBM's reply left me a little baffled. Sounds like it is saying
No, you can't qualify a sequence.
Yes, you can qualify a sequence, if you use SQL naming instead of system
naming.
Yes, you can qualify a sequence, but not where you are doing it. Only in
"SQL schema statements", whatever those are.

<snip>
Rob -

The use of a '/' in a qualified sequence name is not allowed with the NEXT
VALUE FOR clause. This is documented in the SQL Reference. In the
"Sequence reference" section, the grammar is given as:

sequence-reference:

|--+-nextval-expression-+---------------------------------------|
'-prevval-expression-'

nextval-expression:

|--NEXT VALUE--FOR--sequence-name-------------------------------|

prevval-expression:

|--PREVIOUS VALUE--FOR--sequence-name---------------------------|


The section that defines sequence-name states:

A qualified or unqualified name that designates a sequence. The qualified
form of a sequence-name depends upon the naming option. For SQL naming,
the
qualified form is a schema-name followed by a period (.) and an SQL
identifier. For system naming, the qualified form is a schema-name
followed
by a slash (/) followed by an SQL identifier. For system naming, a
sequence-name cannot be qualified when used in a NEXT VALUE or PREVIOUS
VALUE expression (the qualified form is only allowed in SQL schema
statements).

The unqualified form of a sequence-name is an SQL identifier. The
unqualified form is implicitly qualified based on the rules
specified
in Qualification of unqualified object names.

A sequence-name can specify either the name of the sequence or the
system object name of the sequence.



You can use SQL naming if you wish to qualify the sequence name.

</snip>

So, I tried using SQL naming. And by golly it worked. So, does this mean
that system naming is now deprecated?
INSERT INTO testlib.ORDLINE (ORDERNBR, ORDERLINE, ACTIVE,
ITEMNUMBER, ORDERQUANTITY, SOMENBR) VALUES(1, 6, '1',
'Item 1', second(current time), NEXT VALUE FOR testlib.SEQUENCE)

Rob Berendt

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.