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

can we declare occurs in 01 level?

2 Answers   Temenos,


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?

2 Answers   IBM,


how can i see junk values in dclgen or in hostvariable of comp ?

0 Answers   DELL,


What are the different data types in cobol?

0 Answers  


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

8 Answers   Syntel,






WT R TECHNICAL MAINFRAME QUESTION ASKED IIN ANJANASOFTEARE??

1 Answers  


How to display string in the reverse order using occurs clause?

4 Answers  


What is the difference between COMP & COMP-3 ?

2 Answers  


What does MAXCC 3 means? It is used in one my codes.

2 Answers   Wipro,


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.

2 Answers  


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

9 Answers   HSBC,


How many types of sorts are there in cobol?

5 Answers   Cap Gemini,


Categories