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 |
1.Can we define condition-name conditions in FD entry.
What are different file OPEN modes available in COBOL?
What kind of error is trapped by on size error option?
How to display the index.(displacement from an array)
how you read control card into array?
suppose there is one PF having two members PF1 PF2.PF has one unique key Emp ID.could you tell me uniqueness in PF will be effective across members as well ? assume emp iD 3333 is in member PF1 would same Emp id be exist also in member PF2 ?
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
0 Answers TryTechnicals Pvt Ltd,
What is reference modification? What is UNION in sql and syntax? What is the difference between GDGS and VSAM? Which is prefer one? What is processing groups in endevor?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
How do you code Cobol to access a parameter that has been defined in JCL?
in a indexed file what is procedure for read the records from 12 to 18. please give the code example
01 a pic s9(5) occupies how many bytes ?