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 > com.ibm.db2.jcc.b.nm: DB2 SQL Error: SQLCODE=-401, SQLSTATE=42818, SQLERRMC==,

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Oct 2009
Posts: 16
com.ibm.db2.jcc.b.nm: DB2 SQL Error: SQLCODE=-401, SQLSTATE=42818, SQLERRMC==,

Hi

i want to select the roles for a product.

i am getting following exception ..and what could be reason.

Please any help will be appreciated


com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [/AdminRoleProduct.jsp]: Initialization successful.
[10/13/09 12:30:22:695 IST] 0000003e application E com.ibm.db2.jcc.b.nm: DB2 SQL Error: SQLCODE=-401, SQLSTATE=42818, SQLERRMC==, DRIVER=3.50.152
javax.faces.el.EvaluationException: com.ibm.db2.jcc.b.nm: DB2 SQL Error: SQLCODE=-401, SQLSTATE=42818, SQLERRMC==, DRIVER=3.50.152


Thanks in advance

Ramesh
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Jan 2003
Posts: 4,119
SQL0401N The data types of the operands for the operation "<operator>"
are not compatible.

Explanation:

The operation using "<operator>" cannot be processed for one of the
following reasons:

* The data types of the operands must be compatible but there is at
least one pair of types that is not compatible.
* The data type of an operand is XML which cannot be compared (with
itself or any other type).
* The data type of an operand is DATALINK which cannot be compared
(with itself or any other type).
* The data type of an operand is a structured type which cannot be
compared (with itself or any other type).

Federated system users: this data type violation can be at the data
source or at the federated server.

Some data sources do not provide the appropriate values for
"<operator>". In these cases the message token will have the following
format: "<data source>:UNKNOWN", indicating that the actual value for
the specified data source is unknown.

The statement cannot be processed.

User response:

Check all operand data types to ensure that they are comparable and
compatible with the statement usage.

If all the SQL statement operands are correct and accessing a view,
check the data types of all the view operands.

Federated system users: if the reason is unknown, isolate the problem to
the data source failing the request (see the Troubleshooting Guide for
procedures to follow to identify the failing data source) and examine
the data type restrictions for that data source.

sqlcode: -401

sqlstate: 42818



Andy
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Oct 2009
Posts: 16
Hi

I did not get you .. what exactly it meant

The data types of the operands for the operation "<operator>"
are not compatible.

Can you please explain some easy way.

Thanks and Regards
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: May 2009
Posts: 505
ramesh.ibm, The error message means just what it says. You have a comparison using = (the <operator> from your actual error message) that has different data types that DB2 can not compare. For example:

123 = '123'

can not be compared. One date type is a numeric (Smallint) and the other is a alpha (Character).

Check your SQL and see what the various data types are of the columns / values you are comparing. Once you find it, you can probably convert one data type so it does match (i.e. using CAST).
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