DB2 is the database management system that delivers a flexible and cost-effective database platform to build robust on demand business applications. DB2 further leverages your resources with broad support for open standards and popular development platforms like J2EE and Microsoft .NET. The DB2 family also includes solutions tailored for specific needs like business intelligence and advanced tooling. Whether your business is large or small, DB2 has a solution built and priced to meet your unique needs.
DB2 Interviews are getting tough these days as the technology grows faster. To get through the DB2 interview one needs to update him/herself in a regular manner. Having said that, just before the interview, it is very important to have a quick glance of the reputed DB2 questions and answers to make yourself comfortable during the interview process. This is where DoAnswers.com helps you in renewing yourself on DB2 and various other technologies interview preparation.
21. how can we run a cobol-db2 program after bind ?
Using the utility IKJEFT01 in the JCL. By using any condition is there any way to abend a program.?If so how? We can abend the program based on certain conditons. If the condition is satisfied call the program 'ILBOABN0' using abned code. CALL 'ILBOABN0' USING U0165.
22. How can you quickly find out the # of rows updated after an update statement?
Check the value stored in SQLERRD(3).
23. How do I create a table MANAGER ( EMP#, MANAGER) where MANAGER is a foreign key which references to EMP# in the same table? Give the exact DDL.
First CREATE MANAGER table with EMP# as the primary key. Then ALTER it to define the foreign key. When is the authorization check on DB2 objects done - at BIND time or run time? At run time.
24. How do I see the table definitions (columns, data types of columns, constraints or default values set etc) of a table in QMF? I tried 'DESCRIBE TABLE' but didn't work (not able to execute in QMF). I can see the DCLGEN but looking for a way to see the actu
SELECT * FROM SYSIBM.SYSCOLUMNS WHERE TBNAME=table-name AND TBCREATOR=' creator-name'; or to see column names, types and lengths SELECT NAME,COLTYPE,LENGTH FROM SYSIBM.SYSCOLUMNS WHERE TBNAME=table-name AND TBCREATOR=' creator-name'; the above queries can be used
25. How do you concatenate the FIRSTNAME and LASTNAME from EMP table to give a complete name?
SELECT FIRSTNAME || ' ' || LASTNAME FROM EMP;
26. How do you do the EXPLAIN of a dynamic SQL statement?
1. Use SPUFI or QMF to EXPLAIN the dynamic SQL statement
2. Include EXPLAIN command in the embedded dynamic SQL statements
27. How do you eliminate duplicate values in DB2 SELECT ?
Use SELECT DISTINCT ... in db2 query
28. How do you find the maximum value in a column in db2?
Use SELECT MAX(...) .. in db2 query
29. How do you insert a record with a nullable column?
To insert a NULL, move -1 to the null indicator To insert a valid value, move 0 to the null indicator
30. How do you leave the cursor open after issuing a COMMIT? ( for DB2 2.3 or above only )
Use WITH HOLD option in DECLARE CURSOR statement. But, it has not effect in psuedo-conversational CICS programs.