473,395 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem with sequence in UDB 8.2


Folks,

I am having problem running select query from a sequence. I get SQL0204N
error. I am running UDB 8.2 on AIX 5.2.

# oslevel
5.2.0.0

# db2level
DB21085I Instance "dba2test" uses "32" bits and DB2 code release "SQL08021"
with level identifier "03020106".
Informational tokens are "DB2 v8.1.1.80", "s041221", "U800400", and FixPak "8".
Product is installed at "/usr/opt/db2_08_01".

# db2 -svtf ~/tmp/w
CREATE SEQUENCE A2TEST.NEXTFRAGNUM AS INTEGER MINVALUE 1032 MAXVALUE 2147483647 START WITH 1032 INCREMENT BY 1 CACHE 20 NO CYCLE ORDER
DB20000I The SQL command completed successfully.
# db2 "SELECT NEXT_NUMBER FROM A2TEST.NEXTFRAGNUM FOR UPDATE OF NEXT_NUMBER"
SQL0204N "A2TEST.NEXTFRAGNUM" is an undefined name. SQLSTATE=42704
What am I doing wrong?

The above SQL statements works fine on a UDB 7.2 database.


--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #1
1 2299
Hemant Shah wrote:
Folks,

I am having problem running select query from a sequence. I get SQL0204N
error. I am running UDB 8.2 on AIX 5.2.

# oslevel
5.2.0.0

# db2level
DB21085I Instance "dba2test" uses "32" bits and DB2 code release "SQL08021"
with level identifier "03020106".
Informational tokens are "DB2 v8.1.1.80", "s041221", "U800400", and FixPak "8".
Product is installed at "/usr/opt/db2_08_01".

# db2 -svtf ~/tmp/w
CREATE SEQUENCE A2TEST.NEXTFRAGNUM AS INTEGER MINVALUE 1032 MAXVALUE 2147483647 START WITH 1032 INCREMENT BY 1 CACHE 20 NO CYCLE ORDER
DB20000I The SQL command completed successfully.
# db2 "SELECT NEXT_NUMBER FROM A2TEST.NEXTFRAGNUM FOR UPDATE OF NEXT_NUMBER"
SQL0204N "A2TEST.NEXTFRAGNUM" is an undefined name. SQLSTATE=42704
What am I doing wrong? A sequence is not a table.
The above SQL statements works fine on a UDB 7.2 database.

Presumably you have a table named "A2TEST"."NEXTFRAGNUM" in the V7.2 DB?

To access a sequence value use:
NEXT VALUE FOR A2TEST.NEXTFRAGNUM
to access the last generated value:
PREVIOUS VALUE FOR A2TEST.NEXTFRAGNUM

(In V7 you may need NEXTVAL and PREVVAL instead.. We didn't have the SQL
Standard syntax nailed yet)

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Max | last post by:
Suppose we have an object hierarchy in XSD. For example, let us take Control, Label, TextBox and LinkLabel windows controls. Each control has some properties which are represented as elements....
2
by: yqlu | last post by:
I hava developed a client in C# that is connected to a 3-party XML Web Services developed in Java based on the AXIS 1.1. Most methods call are successful except for one method named "findObjects"...
1
by: leslie_tighe | last post by:
Hello, I have webservice created with Axis 1.2.1 and that I am trying to consuming in .NET (VB) using the Microsoft provided tools. While I am able to consume methods on the service that return...
4
by: leslie_tighe | last post by:
Hello, I have a webservice running on a J2EE server created with Axis 1.2.. I have a client that I am building in .net that needs to consume this webserivce and am having a bit of trouble. I have...
0
by: leslie_tighe | last post by:
Hello, I have a web service that is running in a java server using axis that I want to use from .net. In VS.net 2003 I setup a project with a web reference. Using generated code I am able to...
0
by: ryan | last post by:
I've been tasked with consuming a Perl web service that was written by a person in a different department of my company. The problem is it's the guy's first attempt at web services and he doesn't...
0
by: bbalet.free.fr | last post by:
The “Add Web Reference” Visual tool generates bad classes (from WSDL schema) for ComplexType containing only one element (wsdl.exe and wseWsdl3.exe tools have the same problem) : if a...
0
by: bbalet.free.fr | last post by:
The “Add Web Reference” Visual tool generates bad classes (from WSDL schema) for ComplexType containing only one element (wsdl.exe and wseWsdl3.exe tools have the same problem) : if a...
3
by: Eric Lilja | last post by:
Hello again, I'm having a new problem converting a dtd to an xml schema. This once is a little bit more complicated than in my previous question. The following file validates correctly: <?xml...
4
by: IsValidUN | last post by:
I have an XSD which has an import to an XSD located on the web which has a DTD within it. (Using VS-2005 2.0 framework) If I load the XSD using the following, it can't find elements defined within...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.