If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Sqlcode=-204

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-11, 13:22
db2user1 db2user1 is offline
Registered User
 
Join Date: Oct 2011
Posts: 3
Sqlcode=-204

I have created a database using an SQL script. When I try to access any of the tables I get a SQLSyntaxErrorException with SQLCODE=-204.

When I print out the tablenames using metadata.getTables(...), I do see a bunch of table names incl. the one I am trying to access.

The offending line is
ResultSet rs = s0.executeQuery("SELECT * FROM XYZ")
Reply With Quote
  #2 (permalink)  
Old 10-05-11, 13:27
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Check the table schema
Reply With Quote
  #3 (permalink)  
Old 10-05-11, 13:41
db2user1 db2user1 is offline
Registered User
 
Join Date: Oct 2011
Posts: 3
The first line of the script file is

CREATE SCHEMA "Schema";

I tried executeQuery("SELECT * from Schema.XYZ") -- same error msg
and executeQuery("SELECT * from <DB>.Schema.XYZ") -- same problem

Thanks!
Reply With Quote
  #4 (permalink)  
Old 10-05-11, 14:00
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Reply With Quote
  #5 (permalink)  
Old 10-05-11, 14:08
db2user1 db2user1 is offline
Registered User
 
Join Date: Oct 2011
Posts: 3
Unhappy

Unfortunately that's not of much help
Any suggestions of what I can do/look at to try and track down this problem??
Thanks!
Reply With Quote
  #6 (permalink)  
Old 10-05-11, 17:50
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by db2user1 View Post
Unfortunately that's not of much help
Your problem statement does not make a lot of sense either.

I gave you the link that explains how to describe problems so that other people can help.
Reply With Quote
  #7 (permalink)  
Old 10-07-11, 03:09
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
execute : select distinct creator from sysibm.systables to find all schema names
select creator from sysibm.systables where name='tablename'
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On