View previous topic :: View next topic |
Author |
Message |
jctgf Beginner
Joined: 05 Nov 2006 Posts: 89 Topics: 36
|
Posted: Tue Mar 25, 2008 6:48 pm Post subject: impossible sqlcode 100 |
|
|
Hi there,
I am experiencing a problem when trying to retrieve a line with a select command.
My query is as follows:
Code: |
SELECT A_CODE
FROM DB2ABC.TABLE
WHERE X_TEXT = :WS-TEXT |
The X_TEXT column is 150 characters wide and my WS-TEXT variable is pic x(150).
The value I have moved to WS-TEXT exists in the table but the query retrieves no row.
My question:
Is there a limitation in DB2 that causes an undesirable sqlcode 100 when a column is too wide, even when the "where" clause has a valid argument?
Thanks.
JC |
|
Back to top |
|
|
CraigG Intermediate
Joined: 02 May 2007 Posts: 202 Topics: 0 Location: Viginia, USA
|
Posted: Tue Mar 25, 2008 7:47 pm Post subject: |
|
|
Is X_TEXT CHAR(150) or VARCHAR(150)? If it is VARCHAR then WS-TEXT must have a two byte binary length at the beginning of it. |
|
Back to top |
|
|
jctgf Beginner
Joined: 05 Nov 2006 Posts: 89 Topics: 36
|
Posted: Wed Mar 26, 2008 4:15 am Post subject: |
|
|
CraigG wrote: | Is X_TEXT CHAR(150) or VARCHAR(150)? If it is VARCHAR then WS-TEXT must have a two byte binary length at the beginning of it. |
hi,
it's a char column.
it is possible that, when the column is too wide, db2 simply ignores the column from a certain point on and, by doing so, causes a false sqlcode 100?
the wide column (X_TEXT) is not an index.
thanks. |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Mar 26, 2008 5:13 am Post subject: |
|
|
Quote: |
it is possible that, when the column is too wide, db2 simply ignores the column from a certain point on and, by doing so, causes a false sqlcode 100?
|
your host variable does not contain a value equal to any row/column. Stop hoping db2 is making a mistake. double check your column value. if you have file-aid look at the column in hex. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
jctgf Beginner
Joined: 05 Nov 2006 Posts: 89 Topics: 36
|
Posted: Wed Mar 26, 2008 5:54 pm Post subject: |
|
|
dbzTHEdinosauer wrote: | Quote: |
it is possible that, when the column is too wide, db2 simply ignores the column from a certain point on and, by doing so, causes a false sqlcode 100?
|
your host variable does not contain a value equal to any row/column. Stop hoping db2 is making a mistake. double check your column value. if you have file-aid look at the column in hex. |
my variable contains the right value (i have doubled checked its hex value and haven't found any problem) but i have found the error.
that variable received its value from variable A and this one was a group item. i modified variable A so that it is also a pic x(150) and now it's working.
thanks. |
|
Back to top |
|
|
|
|