View previous topic :: View next topic
|
Author |
Message |
mfhelp Warnings : 1 New User
Joined: 29 Jun 2006 Posts: 33
|
|
|
|
I am getting -401 Error during bind operation which means operand used in comparison not compatible. How can I come to know which statement caused this error. There are many SQLs used in my prog. Is there any precompiler option which will list all the SQL statments with the line no so that i can trace the problematic one. |
|
Back to top |
|
|
MFRASHEED
Active User
Joined: 14 Jun 2005 Posts: 186 Location: USA
|
|
|
|
Can you put your bind card here.
-401 means
Code: |
-401 THE OPERANDS OF AN ARITHMETIC OR COMPARISON OPERATION ARE NOT
COMPARABLE
Explanation: An arithmetic operation appearing within the SQL statement
contains a mixture of numeric and non-numeric operands, or the operands of
a comparison operation are not compatible.
One reason for this error is that a field procedure exists on one of the
columns. If one column of arithmetic or comparison operation is defined
with a field procedure, other columns in the operation must be defined
with the same field procedure.
System Action: The statement cannot be executed.
Programmer Response: Check the data types of all operands to ensure that
their data types are comparable and compatible with their usage in the
statement.
If all the operands of the SQL statement are correct, then, if a view is
being accessed, check the data types of all the operands in the view
definition.
|
|
|
Back to top |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
hello,
Finding any SQL error in DB2 cobol/Pl1 any lang for that reason
1. See the bind step in detail, to find the satement number where the SQLcode is negative.
2. Then in the (note this) modified program, you need to search for that number.
3. Scroll to the 01 level and find for that variable.
4. You can find where the error has occured, and try to slove it.
I feel your's error is due to pic clause. |
|
Back to top |
|
|
|