How to handle null values in db2

Answers were Sorted based on User's Feedback



How to handle null values in db2..

Answer / lu

you need to declare binary indicator variable....
10 Ind-variable pic s(904) comp.

Is This Answer Correct ?    10 Yes 3 No

How to handle null values in db2..

Answer / biswamoy majumder

To insert a NULL, move -1 to the null indicator, To insert
a valid value, move 0 to the null indicator.
declare separately Null indictor variable in Working-
Storage section.
10 variable-NI pic s9(04) Usage comp.

Is This Answer Correct ?    5 Yes 0 No

How to handle null values in db2..

Answer / yuvaevergreen

IN DCLGEN,
>>"INDICATOR VARS .. ===> NO" indicates the presence of
null variables for the fields in the tables.
>>indicator variable should be declared of type s9(4) comp.
77 DAY-IND PIC S9(4) BINARY.
Move -1 to the indicator variable and use in sql.
exec sql
insert into employee(name)
values(:ws-name:ws-name-ind)
end-exec;
ws-name-ind is the indicator variable which inserts null in
the field ws-name.

Is This Answer Correct ?    3 Yes 0 No

How to handle null values in db2..

Answer / ankitha

you can use value function or null indicators if you want to
handle nulls in program.

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More DB2 Interview Questions

Do we need cursor for Count(*)?

4 Answers   iGate,


When a COBOL-DB2 program in PRODUCTION is updating main tables and gone for long run, what have to do?

0 Answers   Broadridge,


what is difference between Plan and Package

1 Answers   Syntel,


Explain what a plan is?

3 Answers   CTS,


Is schema the same as database?

0 Answers  






what is utility for parm lib

0 Answers   IBM,


Define declaration generator (dclgen).

0 Answers  


List out the three types of page locks that can be held.

0 Answers  


query to just fetch first matching row and stop execution. once one matching row is found ..no more records should be checked.. if the first record is matching.. the query must stop

2 Answers   IBM,


how to resolve -811 sqlcode .give clear explaination

3 Answers   IBM,


How does db2 sample database connect?

0 Answers  


What is the SQL Communications Area and what are some of its key fields?

1 Answers  


Categories