Update -Varchar



IBM's flagship relational database management system

Update -Varchar

Postby itamar rocha » Wed Feb 26, 2014 1:30 am

Hello,
I have a question, when I have the example below:

10 XXXX-DES-DESTINATARIO.
15 XXXX-DES-DESTINATARIO-LEN PIC S9(4) USAGE COMP.
15 XX-DES-DESTINATARIO-TEXT PIC X(1000).

My question is when I have a varchar field, and I want to update the table.
When I have a varchar field I have to set the pic s9(4) with a value?
Because I executed a aplicattion here and the return is -311, 311 means THE INDICATED LENGTH OF A HOST VARIABLE IS NEGATIVE.

Thanks.
itamar rocha
 
Posts: 41
Joined: Mon Nov 11, 2013 8:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Update -Varchar

Postby dick scherrer » Wed Feb 26, 2014 7:58 pm

Hello,

XXXX-DES-DESTINATARIO-LEN
What value is in this field when the -311 is issued?

Should this be a signed field? How can there be a negative length?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Update -Varchar

Postby itamar rocha » Thu Feb 27, 2014 8:43 pm

Hello,
I solved the problem, I used a command "SELECT STRIP" before the update and it worked.
Thanks for the help
itamar rocha
 
Posts: 41
Joined: Mon Nov 11, 2013 8:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Update -Varchar

Postby dick scherrer » Thu Feb 27, 2014 8:55 pm

Good to hear it is working - thank you for letting us know :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post