Results 1 to 7 of 7

Thread: Sqlcode: -204

  1. #1
    Join Date
    Sep 2010
    Posts
    34

    Unanswered: Sqlcode: -204

    Hi!!!

    I have a problem. We have a java applications that when execute a delete statement get a SQLCODE: -204. I know that this error say "table doesn't exists" but the syscat.tables show this the table.

    I can execute the same statement in CLP or control center without problem.

    What should I do?

    The command is very simple:

    delete from myschema.mytable where campo1=valor

    Thanks!!

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    First of all, that is not the exact statement you submitted, nor is it the exact error returned, so it is hard to say what your problem is.

    I do notice that your predicate contains a column that is character, but the value used in the comparison does not have single quotes.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Quote Originally Posted by robert_tr View Post
    Hi!!!

    I have a problem. We have a java applications that when execute a delete statement get a SQLCODE: -204. I know that this error say "table doesn't exists" but the syscat.tables show this the table.

    I can execute the same statement in CLP or control center without problem.

    What should I do?

    The command is very simple:

    delete from myschema.mytable where campo1=valor

    Thanks!!

    Are you connecting to the same database in your java app and your control centre ?
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  4. #4
    Join Date
    Sep 2010
    Posts
    34
    Quote Originally Posted by sathyaram_s View Post
    Are you connecting to the same database in your java app and your control centre ?
    Yes, is the same bd

  5. #5
    Join Date
    Sep 2010
    Posts
    34
    Quote Originally Posted by Marcus_A View Post
    First of all, that is not the exact statement you submitted, nor is it the exact error returned, so it is hard to say what your problem is.

    I do notice that your predicate contains a column that is character, but the value used in the comparison does not have single quotes.
    Thank you.

    OK, the statement is: delete from rrhh.emp where empyear=2011 and empmonth=9 and empday=13

    error:

    [2011-09-12 12:19:27.332] Hold : com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: RRHH.EMP

    THANKS!!!!

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Need to see the following:
    db2 list tables for all

    You can just show the one line that proves RRHH.EMP exists.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  7. #7
    Join Date
    Sep 2010
    Posts
    34
    Quote Originally Posted by Marcus_A View Post
    Need to see the following:
    db2 list tables for all

    You can just show the one line that proves RRHH.EMP exists.
    Thank
    I ran the command and the table exists.

Posting Permissions

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