How to handle null values in db2
Answers were Sorted based on User's Feedback
Answer / lu
you need to declare binary indicator variable....
10 Ind-variable pic s(904) comp.
| Is This Answer Correct ? | 10 Yes | 3 No |
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 |
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 |
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 |
how can u retrieve the data from null values using applicaion program.
Say CUST Table contains records like: CUSTNO CUSTNAME CUSTLOC 100 ABC SSS 200 XYZ 300 PQR 400 MNO WWW 500 CVV ------------- ------------- Now write a query to retrieve all records with CUSTLOC no data.
How many Buffer pools are there in DB2 and what are they?
How does one bind 2 versions of a CICS transaction with the same module name in two different CICS regions that share the same DB2 subsystem?
Define declaration generator (dclgen).
what is datacom db?
How Plan is created while executing the query using SPUFI?
In which column of which DB2 catalog would you find the length of the rows for all tables?
What is the difference between Primary key and unique index?
What is meant by a unit of recovery?
How can the duplicate values be eliminated from db2 select?
What are simple, segmented and partitioned table spaces ?