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



I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different wa..

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

I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different wa..

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

I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different wa..

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

I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different wa..

Answer / kk

hi,
if declare varchar format must declare length and text in
level no 49.

Is This Answer Correct ?    1 Yes 0 No

I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different wa..

Answer / ravi

1.Use Update ....
2.Using Cursor ..for update only.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More COBOL Interview Questions

diffrence between renames and redifnes with examples

3 Answers   IBM,


how to submit a jcl by cobol program. clear me with an example.

3 Answers   HCL,


What is COMP SYNC?

3 Answers  


what is the difference between perform varying and perform until

4 Answers   TCS,


What are some examples of command terminators?

1 Answers  






How do you define a variable of comp-1 and comp-2?

0 Answers  


u have passed sme charecters thru parm parameter in jcl. how do u code in cobol to recieve the values u gave in parm ?

2 Answers   IBM,


If my file contains 100,000 records and job abended at 55,000th records processing then how can i restart job from that record onward by ignoring that record. I can not edit the file as file size is big and it is getting browse substituted?

5 Answers   TCS,


if a>b continue display x. dispaly y. end-if display 1 display 2. display 3. what should be my output ?

3 Answers  


How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?

1 Answers  


suppose a cobol programme A calling programme B,C and D. If C undergoes some change what if A,B,C,D need to be recompiled or only C nee to be recompliled.

2 Answers   IBM,


What is the difference between binary search and sequential search?

0 Answers  


Categories