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.

Answers were Sorted based on User's Feedback



Say CUST Table contains records like: CUSTNO CUSTNAME CUSTLOC 100 ABC SSS ..

Answer / vineet chauhan

no you have to use IS keyword as:


SELECT * FROM CUST
WHERE CUSTLOC IS NULL

Is This Answer Correct ?    11 Yes 2 No

Say CUST Table contains records like: CUSTNO CUSTNAME CUSTLOC 100 ABC SSS ..

Answer / madhuri tungal

In the CUSTLOC field the no data is represented by SPACES
but not by .... i.e NULL VALUE

Hence the query would be,

SELECT * FROM CUST WHERE CUSTLOC IS SPACES;

Is This Answer Correct ?    0 Yes 3 No

Say CUST Table contains records like: CUSTNO CUSTNAME CUSTLOC 100 ABC SSS ..

Answer / sharat

EXEC SQL
SELECT * FROM CUST
WHERE CUSTLOC = NULL
END-EXEC.
Can anyone let me know whether the query coded above is right.

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More DB2 Interview Questions

How could one combine a set of incremental image copies into a single copy?

1 Answers  


How to check last update on table in db2?

0 Answers  


what is sql abend code -801,-802?

2 Answers  


My cobol program(not having any sql statements) is calling another cobol program ( having sql statements), what is needed for compilation and run in jcls .

3 Answers   Cap Gemini, RBS,


Mention a credible reason why select* is never given preference in an sql program that has been embedded.

0 Answers  






we can code COPY DCLGEN or INCLUDE DCLGEN, At which stage of the precompilation , dclgen get expanded if we write 1) copy 2) include one question about dclgen.. Is it mandatory to use declare table in dclgen.. I think no...but it will be used by the precompiler to validate the table name,column name etc.., can one clear my doubt ..is it necessary to include declare table or not?

2 Answers  


How does db2 sample database connect?

0 Answers  


i want to maintain uniqueness on pdf without make lf??????????

0 Answers  


What is meant by the attachment facility?

3 Answers  


What is copy book?

1 Answers   Thomson Reuters,


What is the meaning concurrency in the db2 database?

0 Answers  


How can record locking be achieved in those DB2 versions which do not support it?

0 Answers  


Categories