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

What is the default value(s) for an initialize? What keyword will allow for an override of the default?

661


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

719


For rewrite, why is it mandatory that file needs to be opened?

623


What is the difference between external and global variables in COBOL?

815


What are declaratives and what are their uses in cobol?

714






How do define dynamic array in cobol.

674


Can a Search can be done on a table with or without Index?

806


INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?

426


What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?

679


how do you reference the fixed unblock file formats from cobol programs

712


How many sections are there in data division in COBOL?

680


IF I mention stop run in CICS what happens?

1898


Write a program to explain size error.

678


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

691


What rules are to be followed while using the corresponding options?

642