niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » IBM DB2
Error SQLSTATE=42703
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
Author Message
Patryk
*nix forums beginner


Joined: 25 Mar 2005
Posts: 14

PostPosted: Fri Feb 18, 2005 2:19 pm    Post subject: Re: Error SQLSTATE=42703 Reply with quote

I found same way...
Just pack in another select like this:
SELECT AA.NAME
FROM (SELECT AA.*
FROM (SELECT ROW_NUMBER() OVER() AS ROWNUM, AA.*
FROM S.A AA) AA
WHERE ROWNUM BETWEEN 0 AND 20) AA;

Thank you Serge
Back to top
Patryk
*nix forums beginner


Joined: 25 Mar 2005
Posts: 14

PostPosted: Fri Feb 18, 2005 1:39 pm    Post subject: Re: Error SQLSTATE=42703 Reply with quote

Serge Rielau wrote:
Quote:
Very odd. What's you exact system?

IBM WebSphere Application Server, 5.1.0
Build Number: b0344.02

DB2/NT 8.01.0000

JDBC: IBM DB2 JDBC 2.0 Type 3

I think problem is in WebSphere, not SQL query or JDBC driver (in other
program using JDBC driver is good).
In DB2 console everything work great.

One more thanks for help.
Back to top
Serge Rielau
*nix forums Guru


Joined: 29 Apr 2005
Posts: 1583

PostPosted: Fri Feb 18, 2005 1:12 pm    Post subject: Re: Error SQLSTATE=42703 Reply with quote

Patryk wrote:
Quote:
Serge Rielau wrote:

Patryk wrote:
The error message is a bit surprising, but I think you need AA.*
rather than only *.

Thank for fast answer.
This not help, exception is throw.
I wrote this and again get error in logs:
SELECT AA.C
FROM (
SELECT ROW_NUMBER() OVER() AS ROWNUM, AA.C
FROM S.A AA) AA
WHERE AA.ROWNUM BETWEEN 5 AND 20;
Very odd. What's you exact system? Her eis what I get:

db2 => connect to test;

Database Connection Information

Database server = DB2/NT 8.2.1
SQL authorization ID = SRIELAU
Local database alias = TEST

db2 => create table s.a(c int);
DB20000I The SQL command completed successfully.
db2 => SELECT AA.C
db2 (cont.) => FROM (
db2 (cont.) => SELECT ROW_NUMBER() OVER() AS ROWNUM, AA.C
db2 (cont.) => FROM S.A AA) AA
db2 (cont.) => WHERE AA.ROWNUM BETWEEN 5 AND 20;

C
-----------

0 record(s) selected.

db2 =>

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Back to top
Patryk
*nix forums beginner


Joined: 25 Mar 2005
Posts: 14

PostPosted: Fri Feb 18, 2005 12:43 pm    Post subject: Re: Error SQLSTATE=42703 Reply with quote

Serge Rielau wrote:
Quote:
Patryk wrote:
The error message is a bit surprising, but I think you need AA.* rather
than only *.

Thank for fast answer.

This not help, exception is throw.
I wrote this and again get error in logs:
SELECT AA.C
FROM (
SELECT ROW_NUMBER() OVER() AS ROWNUM, AA.C
FROM S.A AA) AA
WHERE AA.ROWNUM BETWEEN 5 AND 20;
Back to top
Serge Rielau
*nix forums Guru


Joined: 29 Apr 2005
Posts: 1583

PostPosted: Fri Feb 18, 2005 12:24 pm    Post subject: Re: Error SQLSTATE=42703 Reply with quote

Patryk wrote:
Quote:
Hello
I using websphere and db2 (vCool. I have a problem with this select:
SELECT *
FROM (
SELECT ROW_NUMBER() OVER() AS ROWNUM, *
FROM S.A AA) AA
WHERE ROWNUM BETWEEN 5 AND 20;

From console is everything good, no error, but in JDBC (only log) I
got a error:
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0206N
Object "ROWNUM" is not valid in the context where it is used.
SQLSTATE=42703


Anyone could help me find what is wrong?
The error message is a bit surprising, but I think you need AA.* rather

than only *.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Back to top
Patryk
*nix forums beginner


Joined: 25 Mar 2005
Posts: 14

PostPosted: Fri Feb 18, 2005 11:58 am    Post subject: Error SQLSTATE=42703 Reply with quote

Hello
I using websphere and db2 (vCool. I have a problem with this select:
SELECT *
FROM (
SELECT ROW_NUMBER() OVER() AS ROWNUM, *
FROM S.A AA) AA
WHERE ROWNUM BETWEEN 5 AND 20;

From console is everything good, no error, but in JDBC (only log) I
got a error:
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0206N
Object "ROWNUM" is not valid in the context where it is used.
SQLSTATE=42703


Anyone could help me find what is wrong?
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 3:27 am | All times are GMT
navigation Forum index » Databases » IBM DB2
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Postfix + MySQL error: very strange variable %s iWarior Postfix 0 Mon Aug 25, 2008 2:01 pm
No new posts ** Postfix error on console every minute or so ** ?? drywash Postfix 0 Fri Jul 04, 2008 8:49 pm
No new posts Postfix error bounce diwash Postfix 0 Fri Mar 28, 2008 3:37 am
No new posts I am getting following error in Aix 5.3 rockcharles1 AIX 0 Tue Aug 28, 2007 11:06 pm
No new posts postfix out of memory error - please help metind Postfix 0 Mon Sep 11, 2006 1:54 am

Personal Injury Attorney Los Angeles | Loans | Tour Management Software | Debt Consolidation | Debt Consolidation
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1808s ][ Queries: 20 (0.0776s) ][ GZIP on - Debug on ]