Results 1 to 7 of 7

Thread: Sqlcode=-204

  1. #1
    Join Date
    Oct 2011
    Posts
    3

    Unanswered: 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")

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Check the table schema

  3. #3
    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!

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

  5. #5
    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!

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.

  7. #7
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •