MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

impossible sqlcode 100

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
jctgf
Beginner


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Tue Mar 25, 2008 6:48 pm    Post subject: impossible sqlcode 100 Reply with quote

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
View user's profile Send private message Send e-mail
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Tue Mar 25, 2008 7:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
jctgf
Beginner


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Wed Mar 26, 2008 4:15 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Mar 26, 2008 5:13 am    Post subject: Reply with quote

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
View user's profile Send private message
jctgf
Beginner


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Wed Mar 26, 2008 5:54 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group