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?
Answers were Sorted based on User's Feedback
Answer / anoop
As far as my knowledge if there is a VARCHAR in table then
its host variable should have the length field and data
field. I feel you have to populate bothe the fields in order
to update the VARCHAR field. please get it confirmed also.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / 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 |
Answer / shree
Use update query in the COBOL program inside the DB2 code
block
EXEC SQL
UPDATE <TABLE NAME> SET <COLUMN NAME> = 'X'
WHERE CLAUSE
END-EXEC
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / ravi
1.Use Update ....
2.Using Cursor ..for update only.
| Is This Answer Correct ? | 0 Yes | 1 No |
Define cobol?
How to display the index.(displacement from an array)
How do we get current date from system with century in COBOL?
how many times PARA-A is performed : PERFORM PARA-A VARYING TIMES-COUNTER FROM 1 BY 1 UNTIL TIMES-COUNTER >0 PARA-A MOVE P TO Q MOVE H TO TIMES COUNTER a.10 b.1 c.11 d.0
is it possible to pass an SQL query inside a jcl which is inside a cobol program?
In a COBOL II PERFORM statement, when is the conditional tested, before or after the perform execution?
How do you compile cobol program..?
Can we move X(9) to 9(9). If yes what are the ways for doing this?
how can we fetch 3 records in cobol pgm any coding pls ?
What is the difference between PIC 9.99 and 9v99?
Explain fixed length record in cobol? with suitable example
how many subpgms we can use in a main pgm ? how do u link sub pgm to main pgm ? how can i use the parameters declared in main pgm to sub pgm ?