Suppose we have a query for update

update table1
set col1 = 'val1'
where col2=(select .... from ...)

suppose the subquery does not return any record, what will
happen to update?





Suppose we have a query for update update table1 set col1 = 'val1' where col2=(select..

Answer / santosh kumar d

If the col2 field having any null value then that value to
be updated.
If col2 doesn't have any null value then record remains same
nothing will be updated.

Is This Answer Correct ?    4 Yes 6 No

Post New Answer

More DB2 Interview Questions

How do I handle -911 (deadlock) error in a db2 program so that the program will never abend?

3 Answers   CTS, IBM,


where will u check for sqlcode ?

2 Answers   TCS,


I have a table name Table1 which contain columns Cust_no, car_model, country, salesamt. The records are 101, Fiat, India, 12345 2nd record is 102, Tata, USA, 98743 3rd record is 101, indica, India, 65342 4th record is 103, Toyota, UK, 64522 5th record is 103, Maruti, USA, 98632 and so on..... Now my question is write sql query which will give me detail about the sum of sales amount in perticular country

2 Answers   IBM,


What techniques will be used to avoid deadlock??

5 Answers   IBM, SUN,


how to resolve -811 error. give clear explination

4 Answers   IBM,






What is the difference between static and dynamic SQL?

1 Answers  


SI Stud name Subject Marks Pass/Fail 1 Sham Maths 40 P 1 Sham Physics 50 P 1 Sham Bio 20 F 2 Ram Maths 40 P 2 Ram Physics 50 P 2 Ram Bio 60 P For the above data , write the SQL query for the student who passed in all the subjects . For eg : I want the data of only Ram coz he passed all subjects .

2 Answers   Cognizant,


Normalization in DB2 – first normal form, second normal form

4 Answers   Virtusa,


What are db2 objects?

0 Answers  


Usually, which is more important for DB2 system performance - CPU processing or I/O access?

1 Answers  


What is a host variable?

3 Answers  


How will fetch last 5 rows from table in db2

6 Answers  


Categories