☞ DB2 Interview Questions

Here i will post all the probable interview questions which can be asked on DB2.Keep checking this page once in a while as it will be updated with more and more questions in coming days.

❶  I am trying to create a unique index on column , but it's failing. what could be the reason ??

✓ The column on which you are trying to create a unique index, already contain a duplicate value.

❷ In my application program , accidentally my open cursor statement got deleted. what error i will get ??

✓ You will get SQLCODE  -501

❸ What is IRLM ??

IRLM stands for  Intersystem Resource Lock Manager which is responsible for managing DB2 locks (including deadlock detection). It is both a separate subsystem and an integral component of DB2.The default name of this address space is IRLMPROC.

❹ What's the difference between lock and latch ??

❺ If i drop my table what would happen to my existing views ,synonym ,alias and index on that table ??

✓Once the Table is dropped, all existing views,synonym and indexes on the table gets automatically dropped while aliases are not.

❻ Are Views Updateable??

✓ Not all of them.Views that join tables,use functions,use Distinct or use Group By and Having Clause CANNOT be Updated.

❼ Can we use MAX Function on CHAR Column??

✓ Yes offcourse.

❽ Can we use UNION in embedded SQL?

✓ The answer is YES,provided it is used only in Cursor.Why so?? Union gives the result which is nothing but the combination of the rows.So if it is not used in Cursor ,then result of a query can have multiple rows and as you know without Cursor you cannot handle multiple rows in program (you have high risk of getting SQL CODE -811 if you use Union which is not in cursor)

9.  In a COBOL-DB2 program, Do we need to rebind the DBRM even if we have non-DB2 changes in the program ? If yes, why?

✓ Yes, because even though the changes are not related to DB2(SQL) but when we compile the program the new consistency token is created and if we don't bind it will fail at run time with -805/818 saying consistency token does not match. If you want to know in detail, how this works, please refer the post here