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 09-21-11, 13:32
robert_tr robert_tr is offline
Registered User
 
Join Date: Sep 2010
Posts: 34
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!!
Reply With Quote
  #2 (permalink)  
Old 09-21-11, 13:56
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #3 (permalink)  
Old 09-21-11, 14:07
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #4 (permalink)  
Old 09-21-11, 14:17
robert_tr robert_tr is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 09-22-11, 11:50
robert_tr robert_tr is offline
Registered User
 
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!!!!
Reply With Quote
  #6 (permalink)  
Old 09-22-11, 12:41
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #7 (permalink)  
Old 09-22-11, 13:02
robert_tr robert_tr is offline
Registered User
 
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.
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