I have one column say 'X' defined as VARCHAR
Can anyone tell me What are the different ways to update
this column thru COBOL-DB2 program?

Answer Posted / priyanka

If a variable is defined as varchar, the filed will have a
length variable also. Before updating the value 'X', you
need to move the length of the new value to length filed
of 'X'.
Eg: If you want to update 'TEST' in 'X'.

MOVE LENGTH OF 'TEST' TO X-LENGTH
exec sql
UPDATE table
SET X = 'TEST'
Where clause
end-exec

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is not true about evaluate statement

1560


Difference between cobol and cobol-ii?

695


How you can read the file from bottom?

650


Write the code implementing the perform … varying.

633


What are the different types of condition in cobol and write their forms.

647






Explain how to differentiate call by context by comparing it to other calls?

677


How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

697


What is report-item in COBOL?

700


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17009


What is a SSRANGE and NOSSRANGE?

802


What is the difference between next sentence and continue in cobol programing language?

695


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1513


How do you differentiate between cobol and cobol-ii?

643


How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

391


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

809