GeekInterview.com
Series: Subject: Topic:

DB2 Interview Questions

Showing Questions 1 - 20 of 207 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

Db2 control structure

Asked By: radibioinfo | Asked On: Oct 4th, 2007

A control structure used by db2 to communicate with the application program isa.Address spaceb.Authidc.Threadd.Viewe.String thread

Answered by: Lalit Pant on: Jul 10th, 2014

The answer is thread. The thread is used by the DB2 to pass the results of the query to the application program.
SQLCA is the set of variables that are used by DB2 to pass the status and error messages of the query execution to the program and are used in error routines and paragraphs.

Answered by: prachi patankar on: Jun 22nd, 2014

SQLCA

How many rows will the query return ?

Asked By: radibioinfo | Asked On: Oct 4th, 2007

Table1 has 6 rows and table2 has 6 select * from table1, table2; a.6b.12c.36d.720e.Cannot sayrows.36

Answered by: lalit on: Jul 10th, 2014

It will return 12 rows

Answered by: sudhir jain on: Aug 6th, 2013

It will give all the columns from table 1 and table2

Db2 cursor stablity

Asked By: radibioinfo | Asked On: Oct 4th, 2007

I) cursor stablity leads to higher concurency ii) repeatable read leads to higher consistency1 both are true2 i) is only true3 ii) is only true4 neither is trueboth are true

Answered by: Gurumoorthy K on: Jul 3rd, 2014

4. Neither is true.

Cursor Stability Leads to Higher Consistency which means the data is very much reliable.
Repeatable Read Leads to Higher concurrency, means data availability as there is no lock over the table.

Guru

Answered by: yuvaevergreen on: Mar 26th, 2010

Decreasing preference for concurrency: (CS)(RS)(RR)(UR)Decreasing preference for consistency: (UR)(RR)(RS)(CS)

Can we use sum function on alphanumeric column ?

Asked By: praveen_s | Asked On: Apr 18th, 2012

Answered by: Gurumoorthy K on: Jul 3rd, 2014

No, you cant use SUM on char columns. But few other functions can be used like MAX, MIN etc.

Answered by: daniel.epps on: Apr 19th, 2012

Yes

Db2 cursor declaration

Asked By: radibioinfo | Asked On: Oct 4th, 2007

The cursor can be declared in working storage sectionlinkage sectioninput-output section. working storage section

Answered by: PRACHI PATANKAR on: Jun 22nd, 2014

Working storage section

Answered by: Mandar Dindorkar on: Jul 27th, 2012

Cursor Declaration can be done either in WORKING STORAGE SECTION in DATA DIVISION or in PROCEDURE DIVISION, the only rule is that it has to be coded before the OPEN CURSOR statement in the Procedure Division.

Db2 indexes

Asked By: radibioinfo | Asked On: Oct 4th, 2007

I ) unique index can be created only on primary key. Ii) query will execute faster if predicates are applied on indexed column. 1 both are true2 i) is only true3 ii) is only true4 neither is true

Answered by: Prachi Patankar on: Jun 22nd, 2014

Both are true

Answered by: madhavan on: Mar 10th, 2014

SELECT * FROM Table_name where condition

FETCH FIRST 10 ROWS ONLY;

How do you display last 5 records in db2?

Asked By: chhavis928 | Asked On: Aug 25th, 2011

Answered by: madhavan on: Mar 10th, 2014

SELECT * FROM Table_Name order by column_name desc Fetch first 5 rows only;

Answered by: Mohit on: May 28th, 2012

There is nothing called "fetch last n records only" in db2...

You can use select col1 from table1 order by col1 desc fetch first 5 records only

How to convert non-db2 files into db2 format for ex . Data in excel, ms-acces, Oracle etc.

Asked By: latha | Asked On: Aug 22nd, 2007

Answered by: Anoop Nair on: Feb 26th, 2014

You can convert non mainframe files like excel to mainframe raw files using FTP. Inside FTP tool, choose the option LAN to Mainframe and then process the request.

Db2 table change - how impact analysis can be done?

Asked By: clrMFint | Asked On: Feb 20th, 2014

If any db2 column changed,how impact analysis can be done fo this?

What will happened ,if the subprogram is called second time?

Asked By: Interview Candidate | Asked On: Jun 6th, 2005

Answered by: Mahaveer on: Feb 2nd, 2014

Code Program-idIS INITIAL PROGRAM
If IS INITIAL is coded along with program id of of sub program then the program will be in intial stage every time it is called
OR CANCEL is issued after CALL will set the sub program to initial state

Answered by: GZ on: Apr 2nd, 2006

variables might already be in initiated state due to first run.

What is the difference between package and plan?

Asked By: priya | Asked On: Jun 21st, 2007

Answered by: Mandar Dindorkar on: Jul 27th, 2012

the difference is that a Package is at a more granular level. If a module is bound to a Package, any change in module requires only the Package to be re-bound, without the necessity to re-bind the ent...

Answered by: sam117 on: Dec 25th, 2009

Package can be bound for single DBRM only. Plan can contain both DBRM and Packages. Packaqes can't be executed until they are bound into a plan. 

How do you improve db2 SQL performance?

Asked By: Anilsodadasi | Asked On: Apr 25th, 2007

Answered by: Mandar Dindorkar on: Jul 27th, 2012

A

Answered by: kalone on: Feb 1st, 2010

To improve the performance following are some of the tips :1. Always use FOR UPDATE OF when updating with a cursor.2. Use WHERE CURRENT OF to delete a single row.3. Check the SQLCODE after each SQL statemnt.4. Avoid using WHENEVER.

Difference between embedded SQL and dynamic SQL?

Asked By: krishna | Asked On: Jun 24th, 2006

Answered by: Mandar Dindorkar on: Jul 27th, 2012

Embedded SQL -> Access Path is generated during BIND time. also table authorizations are checked during BIND (if VALIDATE(BIND) is used).

Dynamic SQL => Access path is generated during Run-time. Table authorizations can only be checked during run-time.

Answered by: kalone on: Feb 1st, 2010

STATIC sql(embedded) : It is hardcoded in the program itself and the changeable                   &n...

If SQL return -805 , what will user want to do

Asked By: sprabodhini | Asked On: May 7th, 2008

Answered by: Mandar Dindorkar on: Jul 27th, 2012

-805 will never occur if a DBRM is directly bound to a PLAN. -805 occurs when 1) Source Program is changed and per-compiled and new LOAD Module created as a result of change is used at Run time, but ...

Answered by: jzmoonrock56 on: Aug 31st, 2011

Rebind the plan.

What is a db2 access path?

Asked By: Interview Candidate | Asked On: Oct 13th, 2004

An access path is the method used to access data specified in db2 SQL statements.

Answered by: Mandar Dindorkar on: Jul 27th, 2012

DB2 Access path is (in most cases) the path which results in the most optimized execution of an SQL query. Whenever any Static SQL (Embedded SQL) is bound to a package/plan, the DB2 optimizer creates...

Answered by: jzmoonrock56 on: Aug 31st, 2011

The access path is determined by DB2 during the bind process. This determines what indexes will be used.

What is check pending and copy pending status in db2, how do you resolve it?

Asked By: Shivanand madhabavi | Asked On: Sep 14th, 2006

Answered by: Mandar Dindorkar on: Jul 27th, 2012

Check Pending is when you have data added to the table using either insert or LOAD utility which violate table check constraints. The IBM DB2 LOAD UTILITY has ENFORCE CONSTRAINTS and similar options w...

Answered by: Mohit on: May 28th, 2012

SET INTEGRITY Option....please read IBM libraries before using this.

Bind parameters

Asked By: bhima123 | Asked On: Oct 28th, 2010

What are the important bind parameters to be used in bind card? What is the significance of each parameter?

Answered by: Mandar Dindorkar on: Jul 27th, 2012

I will say the Answer Depends barring a few parameters which are mostly used. 1) ISOLATION -> Isolation Level to decide level of locking used along with LOCK parameters on the DB2 objects. 2) ACQUI...

Answered by: jzmoonrock56 on: Aug 31st, 2011

The bind parameters are generally generic the most important is isolation level which is always CS and sometimes UR if you want to rock right thru.

What is lock contention?

Asked By: Interview Candidate | Asked On: Oct 13th, 2004

To maintain the integrity of db2 objects the dbd permits access to only on object at a time. Lock contention happens if several objects are required by contending application processes simultaneously.

Answered by: Sandhya.Kishan on: Jul 9th, 2012

Lock contention are used for maintaining concurrency in the DB2® environment.There are several types of contention situations that degrade DB2 performance, including suspension, timeout, and deadlock.
Begin program-specific programming interface information.

What is the self-referencing constraint?

Asked By: Interview Candidate | Asked On: Oct 13th, 2004

A31. The self-referencing constraint limits in a single table the changes to a primary key that the related foreign key defines. The foreign key in a self referencing table must specify the delete cascade rule.

Answered by: Sandhya.Kishan on: Jul 9th, 2012

Self-referencing constraint makes the table both the parent and dependent table in the same referential constraint.
Here the table is created first and then the foreign key is defined to that table.

How does db2 use multiple table indexes?

Asked By: Interview Candidate | Asked On: Oct 13th, 2004

Db2 use the multiple indexes to satisfy multiple predicates in a select statement that are joined by an and or or.

Answered by: Sandhya.Kishan on: Jul 9th, 2012

By using the concept of list prefetch DB2 uses multiple index processing.I is used to satisfy multiple predicates in a select statement that are joined by an AND or OR.

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.