473,585 Members | 2,657 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.NEXTFRAG NUM 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.NEXTFRAG NUM FOR UPDATE OF NEXT_NUMBER"
SQL0204N "A2TEST.NEXTFRA GNUM" 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 2322
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.NEXTFRAG NUM 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.NEXTFRAG NUM FOR UPDATE OF NEXT_NUMBER"
SQL0204N "A2TEST.NEXTFRA GNUM" 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"."NEXTF RAGNUM" in the V7.2 DB?

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

(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
5075
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. Some of the elements are of complex types as well, like bounds - of type rectangle. (See full example in the bottom of the letter.) ...
2
2745
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" and return a complex type "FieldSearchResult". The error message as following : "Cannot assign object of type System.String to an object of type...
1
3418
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 simple type, I cannot consume methods that return complex objects. I have tried experimenting, with this, but am at a bit of loss on where the...
4
1966
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 pasted the wsdl below and have a created a class in VB.net by adding a web refrence to my project. What is odd is that I can successfully call...
0
1435
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 invoke the web service. The Soapscape tells me that an xml reponse is coming back and its pasted below, along with the wsdl file. However, the object...
0
2362
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 know how to create the WDSL. I created web service with Visual Studio that mimics his service and after some tweaking of the soapAction in the WSDL...
0
1227
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 ComplexType A contains only one element, the tool don’t generate a class for the ComplexType A. It generates a class only for the element type (B) included...
0
1984
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 ComplexType A contains only one element, the tool don’t generate a class for the ComplexType A. It generates a class only for the element type (B) included...
3
5626
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 version="1.0" encoding="utf-8"?> <!DOCTYPE books > <books> <book title="Winter's Heart" isbn="123456789"> <author name="Robert Jordan"/>
4
1907
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 the "xmldsig-core-schema.xsd" file, when I validate. Dim oXmlReaderSettings As New XmlReaderSettings() oXmlReaderSettings.ProhibitDtd = False...
0
7908
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7836
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8199
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6606
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, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5389
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.