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 |
can we declare occurs in 01 level?
01 var1 pic s9(9)v99. 01 var2 pic x(30). procedure division. move 12345.99 to var1. move12345.99 to var2. display var1. display var2. what is the output?
how can i see junk values in dclgen or in hostvariable of comp ?
What are the different data types in cobol?
What is the Linkage section? What is the Use and Why the parm length use alway "PARM-LENGTH PIC S9(4) or PIC S9 (4) COMP." any reason?.Please let me know any one... Cheers,Prasad
WT R TECHNICAL MAINFRAME QUESTION ASKED IIN ANJANASOFTEARE??
How to display string in the reverse order using occurs clause?
What is the difference between COMP & COMP-3 ?
What does MAXCC 3 means? It is used in one my codes.
Can anyone tell me how to handle the array beyond the limit. If we have an array or a table which can handle 5000 records but now we have to compensate 20000 records with the same array? how to handle the situation.
01 var1 pic x(10) 01 var2 redefines var1 pic 9(10). then in procedure division move 'abcde' to var1 then waht is the value of var1 and var2
How many types of sorts are there in cobol?