0% found this document useful (0 votes)
19 views18 pages

IBM DB2 Interview Questions

The document provides a comprehensive overview of IBM DB2, covering fundamental concepts such as databases, DB2 components, SQL usage, and various features like isolation levels, buffer pools, and security models. It includes interview questions and answers that delve into technical aspects, such as the differences between data types, logging methods, and functionalities of different components within DB2. Additionally, it highlights the advantages of using DB2 packages and MDC tables, as well as comparisons between various DB2 functionalities.

Uploaded by

Brindha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views18 pages

IBM DB2 Interview Questions

The document provides a comprehensive overview of IBM DB2, covering fundamental concepts such as databases, DB2 components, SQL usage, and various features like isolation levels, buffer pools, and security models. It includes interview questions and answers that delve into technical aspects, such as the differences between data types, logging methods, and functionalities of different components within DB2. Additionally, it highlights the advantages of using DB2 packages and MDC tables, as well as comparisons between various DB2 functionalities.

Uploaded by

Brindha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

IBM DB2 Interview Questions

What do you mean by database?


A database is nothing but an organized collection of information or data stored in tables. You can
easily access, update, and manage the data in the tables. In every database, the information is
stored in the rows and columns of one or more tables. We can use Database Management
Systems (DBMS) to manage or control a database. Also, we can use Structured Query Language
(SQL) to write as well as query data in a database.
2. What is the IBM DB2 database?
In its basic form, DB2 is a relational database management system. It is also a cloud-native
database with which you can store, manage, and retrieve data effectively. Mainly, this database
performs real-time data analytics and low-latency transactions. You can use DB2 for mission-
critical applications since it offers a high level of security as well as continuous availability. With
this database, you can manage both structured and unstructured data effortlessly.
Do you want to get certified and build your career in IBM DB2? Then enroll in "IBM DB2 Online Training" this cour
you to achieve excellence in this domain.

3. What are the significant components of DB2?

There are totally four components in DB2 as follows:

 System Services Component: This component manages system operations, logging,

communication, and so on.

 Locking Services Component: This component is also known as the Internal Resource Lock

Manager. This component comes with the required controls to manage concurrent access to

data. Mainly, it rectifies concurrency issues in addition to deadlocks.

 Database Services Component: This component manages to define, update, and retrieve

users as well as system data. This component is prime in executing SQL statements and

managing the buffer pool.

 Distributed Data facility Component: This component supports distributed database

management.

4. What do you mean by an alias?

It is the substitute for a table or view. In other words, it is the alternative name of objects. The
objects can be tables, sequences, views, etc. An alias is usually defined as a local server. It can
also refer to a table or view at a remote server. We can use an alias if we want to refer to a table
or view in an SQL statement. Another thing is that we can create and drop aliases like we create
and drop tables and views.
5. What is a table space in DB2?

A tablespace is nothing but a set of volumes on disks. The disks contain the data sets where tables
are usually stored. A table space will have linear VSAM datasets. Tables are generally divided
into equal-sized units, known as pages. We can compress data in table spaces, which in turn saves
space and allows for storing more data. DB2 creates two types of table spaces such as partition by
growth and partition by range.

6. What is the language used in DB2?

Structured Query Language (SQL) is nothing but the language used in DB2 to access data from
DB2. With this language, we can define and manipulate data in relational databases. We can
modify data objects such as tables. We can insert, delete, and update data in tables. Not only that,
we can use SQL to authorize users to access tables and views.

7. What do you mean by attachment facility?

An attachment facility is an interface that connects DB2 with other environments. Here, the
environments can be WebSphere, Information Management System (IMS), Customer
Information Control System (CICS), Time Sharing Option (TSO), and Batch. We can use ODBC,
SQLJ, and JDBC interfaces to connect DB2 with other environments.

8. What do you mean by a BufferPool?

A Buffer pool is part of the main memory. You can store tables and indexes in a buffer pool.
Generally, the buffer pool is managed by the database manager.

Every DB2 has a buffer pool. Every new database comes with a buffer pool known as
IBMDEFAULTBP. You can create, drop or modify buffer pools with the help of the statements
such as CREATE BUFFERPOOL, ALTER BUFFERPOOL, and DROP buffer pool.
9. What are isolation levels, and name their types?

The isolation level in DB2 denotes the degree of isolation between the data and other concurrent
processes. There are four isolation levels in DB2: Repeatable Read (RR), Cursor Stability (CS),
Read Stability (RS), and Uncommitted Read (UR).

10. What do you mean by Cursor Stability?

This is one of the isolation levels of IBM DB2. According to cursor stability, a row is locked
when the cursor is pointed at the row. Note that the specific row is accessed during a transaction,
and the lock remains locked until the transaction gets completed. Significantly, an application can
only update the row once the lock is released.

11. What is the Declarations Generator (DCLGEN)?

Usually, it is essential to declare tables and views when you write codes. The declarations
generator, or DCLGEN, generates DECLARE statements for programs written in C in addition to
COBOL. As a result, you can avoid writing codes for statements. Along with that, DCLGEN
generates respective host variable structures.

12. What is Lock Escalation?

It is the process of releasing any number of page locks, LOB, row locks, and XML locks.
Applications on a single table or table space usually make these locks. Whenever a lock
escalation occurs in the database, it releases a message like DSNI0311. Using this message, we
can identify the tablespace where the lock escalation occurred.

13. What do you mean by Aggregate Function?

The function receives a set of inputs but returns only a single value. In other words, the argument
of every aggregate function is a set of values.

ARRAY_AVG, COUNT, AVG, COUNT_BIG, MEDIAN, MAX (aggregate), and SUM are
some examples of aggregate functions.

14. What is SQLCA?

SQLCA refers to SQL Communications Area. SQLCA is a set of variables updated at the end of
every SQL statement execution. There will be only one SQLCA for every application with
executable SQL statements. But at the same time, every multi-threaded application will have
more than one SQLCA.

15. What do you mean by the binding process in DB2?

The binding process uses DB2 as well as DBRM. Here, DBRM is nothing but a database request
module. During the binding process, the SQL statements in the DBRM switch to operational
mode. The binding process builds access paths to the DB2 table. Also, the binding process
supports authenticating users along with validating SQL statements in the DBRM.

16. What is the use of the host variable in DB2?


 You can use host variables to exchange data between applications and DB2.

 You can insert data into a host variable to load the data into a table.
 If you want to change the fields of rows in a table, you can use host variables.

 While evaluating the WHERE as well as HAVING clauses, we can use the data in the host

variable.

 If you want to indicate a NULL value, then you can use the host variable.

17. Name the various authorities in DB2.


 Security Administration Authority – SECADM

 Access Control Administration Authority – ACCESSCTRL

 Database Administration Authority – DBADM

 Data Access Administration Authority – DATAACCESS

 Workload Administration Authority – WLMADM

 SQL Administration Authority – SQLADM

 Explain Administration Authority – EXPLAIN

 LOAD Authority

18. What are the four types of DB2 registry variables?


 Global level profile registry: This registry includes all server-wide environment variable

settings.

 Instance level profile registry: This registry consists of all environment variable settings of

instances

 Instance node-level profile registry: This registry has all the environment variable settings

that belong to a Massively Parallel Processing (MPP)

 User-level profile registry: This registry includes the environment variable settings that

belong to users.

19. What are the monitor elements in DB2, and brief them a bit?

Monitor elements are nothing but the data structures used to update the status of the DB2.
Following are a few examples of monitoring elements in DB2.

 Counter: If any activity happens in DB2, counters record the number of times that activity

occurred.
 Gauge: It represents the volume of activities that happen in DB2. For example, a gauge

indicates how long an activity occurred if the activity is time-dependent.

 Watermark: They are the highest values of various measurements taken against the activities

in DB2. This value is the maximum value of measurement up to this moment.

 Text: They are the text values. For instance, stmt_text returns the text of SQL statements.

 Timestamp: It indicates the time at which activities occurred in DB2.

20. What is CHECK Constraint?

In its basic form, it is a rule that ensures data integrity in DB2. Only based on this rule, values are
allowed to store in one or more columns of a base table. This means that values are stored in a
base table after being verified by the check constraint. When you create a table in DB2, you can
also create the CHECK constraint.

21. What is the Clustering Index?

The clustering index decides how the rows must be physically ordered in a table space. Know that
every table in DB2 comes with a clustering index. We can define clustering index on both
partitioned tablespaces as well as segmented table space. Also, Clustering indexes are highly
helpful in ordering operations, grouping operations, etc.

22. What is the security model of DB2?

Two modes of security control are available in DB2, such as authentication and authorization.

Authentication is the security control used to allow users to access the DB2. It is managed by
external systems.

The authorization is the security control that allows users to access data within the DB2. A
database manager manages it.

IBM DB2 Interview Questions For Experienced


23. Mention the characteristics of the Resource Control Table (RCT).
 The RCT table defines the connection between DB2 as well as CICS. More to the point, it

defines the relationship between CICS transactions as well as DB2 plans.

 RCT contains the elements collected through macros of DSNCRCT


 This table matches the CICS transaction ID to the respective DB2 authorization ID as well as

to the plan ID.

 All the DB2 plans must be registered in the RCT

24. List out the different fields of SQLCA.


 SQLCAID
 SQLCODE
 SQLCABC
 SQLERRML
 SQLERRP
 SQLERRMC
 SQLERRD
 SQLWARNA
 SQLWARN
 SQLSTATE
25. Brief about the Storage Groups (STOGROUP) in DB2.

Essentially, storage groups in DB2 represent a set of volumes on disks. This is where tables and
indexes are stored in datasets. Virtual Storage Access Method (VSAM) catalog stores the
datasets. With storage groups, DB2 defines, deletes, extends, and modifies VSAM datasets.

We can assign table spaces for storage groups. However, it is essential to note that table space is
usually associated with only one storage group, whereas one storage group may be associated
with many tablespaces.

Related Article: VSAM Interview Questions

26. What are the significant differences between Cursor Stability (CS) and
Repeated Read (RR) isolation levels?

Cursor Stability (CS) Repeated Read (RR)

It is the default isolation level and is used if you want


It is one of the isolation levels.
maximum concurrency

It locks only the current row on which the cursor is


It and locks all the rows specified by the SQL stat
positioned

Locks are released once the program moves to the next


All locks are held until a commit or rollback relea
row

CS offers good consistency and data integrity RR offers high-level data integrity due to its locki
27. Can you list out the advantages of using DB2 Packages?

Below is the list of DB2 advantages:

 DB2 packages reduce plan outage time

 They reduce processor execution time

 They reduce CICS starts or exits

 They avoid cloning CICS as well as DB2ENTRY definitions

 They allow specifying collection at execution time.

28. How does DB2 physically store a NULL value?

DB2 physically stores the NULL value by adding an extra byte in prefix to the column value.

29. How can we retrieve rows from the DB2 table in Embedded SQL?

We can use the SELECT statement if we want to retrieve rows from the DB2 table. When more
than one row is returned, you can use the cursor to fetch a single row out of the multiple rows.

30. What are the two types of database logging used in DB2?
 Circular logging: It is a default behavior when you create a new database.

 Archive logging: It is used for roll-forward recovery. The log files are copied from the current

log path. It can be copied from the mirror log path.

31. Can you differentiate INTEGER and SMALLINT data types in DB2?
INTEGER SMALLINT

It is used to store large binary integers with 31 bits It is used to store small binary integers with 15 bits

The range of integers varies from -2147483648 up to


The range of small integers varies from -32,768 up
+2147483647

32. List out the advantages and disadvantages of INTEGER and SMALLINT
data types.
Advantages:
 Both INTEGER and SMALLINT types need tiny spaces for values.
 Using these data types, you can perform arithmetic and sorting operations such as SUM and
MAX.
Disadvantages:
 They can store values only within a limit.
 The database server cannot store values that exceed the capacity of integers.
33. Differentiate DELETE and DROP statements in DB2.
DELETE Statement DROP statement
It deletes a row from a table or
It removes an object or table from the database
view

Only the rows are deleted. No If an object is removed, the objects associated with the dropped object also
other associated entities are removed. It doesn’t matter whether they are associated directly or indirectl
deleted. object.

You can restore the rows using


You cannot restore the table or object.
the ROLLBACK function

34. Can you compare QMF and SPUFI in DB2?


QMF SPUFI

QMF stands for Query Management Facility SPUFI stands for SQL Processor Using File Inpu

It is a query or reporting environment. You can format


It is a SQL execution engine.
reports with QMF.

It needs datasets to store SQL statements as well


You can store your queries in tables and reports in QMF
them to DB2.

It is an add-on product that comes with a cost It is absolutely a free product

There is no need that all the DB2 users should have QMF Every DB2 customer will have SPUFI, undoubte

35. Mention the functionalities of the Buffer Manager in DB2.


 Buffer Manager (BM) accesses data for other DB2 components

 BM uses pools of memory for storing frequently accessed data

 It transfers data between external devices and storage.

 It reduces the number of physical I/O operations with the help of advanced buffering

techniques such as read-ahead buffering in addition to look-aside buffering.

36. Differentiate Simple, Partitioned, and Segmented Table Spaces.

Simple Segmented Partitioned

It contains one or more tables It contains one or more tables It contains only one table row
and stores rows for all tables

A tablespace is divided into multiple equal- A tablespace is divided into


Rows from multiple tables
sized segments. This is where tables are parts. Here, rows are stored
can be interleaved
stored. parts.

37. Mention the four environments that access DB2.

IMS, TSO, CICS, and BATCH are the four environments that can access DB2 seamlessly.

38. What is the use of DB2 optimizer, and how does it find the optimum
access plan?

DB2 optimizer processes every SQL statement and selects a query access plan. It estimates the
execution costs of multiple access plans and selects the access plan with the minimum cost.

When selecting the optimum access plan, the DB optimizer achieves it in the following way.

 It verifies the syntax of SQL statements

 It determines the table to be accessed

 It identifies the columns that must be returned and the columns in the predicate

 It identifies the indexes for this combination of tables and columns

 Then, it collects the statistics provided in the catalog tables.


39. What are the Advantages of MDC Tables?
 MDC tables use block-based indexes. They are smaller, so they occupy less space and allow

quick scanning.

 They are physically clustered with more than one key or dimension

 Query performance is improved significantly

 MDC tables can maintain their clustering over all dimensions automatically as well as

continuously

40. What are the Pros and Cons of DB2?


Pros:
 You can quickly access data in DB2, especially when the file size is small

 You can easily share data with DB2. This is because it comes with AI capabilities that simplify

sharing structured, semi-structured, and unstructured data with other systems.

 DB2 has compression capabilities with which you can save space significantly without

compromising performance

 You can make hybrid transaction analytical processing with DB2

Cons:
 DB2 responds slowly when the file size is large

 It will only be suitable for modern development if it requires a rigid schema.

IBM DB2 Interview Questions For Advanced


41. How will you find the number of rows or values in a DB2 table?
We can use the COUNT function to get the number of rows in a set of rows or values. The
argument can be of any data type, such as BLOB, DBCLOB, CLOB, and XML.

It is essential to note that the result of this function will be an integer. And it cannot be a null
value.

The argument of the COUNT (*) function is a set of rows. This function returns the number of
rows in a set of rows.

The argument of the COUNT (expression) function is a set of values. This function will return
the number of non-null values in the set. Note that this function includes duplicate values for
counting.

The argument of the COUNT (DISTINCT expression) function is a set of values. This function
will return the number of non-null values in the set. Note that this function removes duplicate
values.
42. How can you move a table space to another DASD volume?

We can move the table space by using ALTER STOGROUP statement. This is possible only
when the tablespace is allocated to that storage group.

43. What is the response of DB2 if a program abends?

When there is a program abend, DB2 performs the auto rollback function.

44. Why don't we prefer using SELECT statements in embedded SQL


programs?

If we change the structure of a table, then we need to change the program. The change can be
adding or deleting a field in the table.

Sometimes, it leads to I/O overhead due to the retrieval of columns that is not required for the
users.

45. Why do you need to create MQT, and how will you create it?

We create Materialized Query Table (MQT) to improve the performance of SQL applications.

If we want to create an MQT, we need to write a CREATE TABLE statement. We need to


specify a full selection too. Then we need to include the DATA INITIALLY DEFERRED as well
as REFRESH DEFERRED clauses to define an MQT.

46. Can you eliminate duplicate values from a table in DB2? If yes, how
will you do this?

Yes. We can remove many identical rows from the result table of a query. You need to use the
DISTINCT keyword in the query to achieve this. This is because the DISTINCT keyword
eliminates the duplicate rows from the query result table. As a result, every result table will
contain only the unique data.

47. If you drop the index of a PLAN, what would be the response?

If this case, it will impact PLANS negatively. The PLANS may contain the SQLs using that
dropped index. Simply put, the PLAN will be marked as invalid.

48. What are the contention situations created by locks in DB2?

Know that locks are essential to achieve concurrency in DB2. Timeout, Suspension, and
Deadlock are the contention situations created by locks. And they will degrade the performance
of DB2, undoubtedly.

 Suspension: This situation occurs when an application requests a lock already held by

another. The requested application must stop its operation until the application releases the

lock. The application resumes its operation only when the lock is released.
 Timeout: This situation occurs when the suspension of an application exceeds the defined

preset level. In that case, DB2 terminates the application and returns error codes.

 Deadlock: This situation occurs when two or more applications lock specific resources and

not allows other applications to access the resources. The main thing is that the other

applications can only proceed with their operations if they access the locked resources.

49. Compare: PLAN and a Package?


PLAN Package

A plan contains many packages or DBRMs A package contains a single DBRM

It is an executable unit since it has access


It is not an executable unit since it doesn’t have any access path
path

Less preferred Highly preferred

50. What is the maximum number of volumes that you can add in a
STOGROUP?

You can add a maximum of 133 volumes in a storage group.

1. How to find the number of rows in a DB2 table?

To find the number of rows in a DB2 table, the user has to use SELECT COUNT (*) on the DB2
query

2. How can the duplicate values be eliminated from DB2 SELECT?

To eliminate the duplicate values from DB2 SELECT, the user has to use SELECT DISTINCT in
the DB2 query.

3. What is Aggregate fucntion?

‘Aggregate’ functions are built-in mathematical tools that are used in the DB2 SELECT clause.

4. Is it possible using MAX on a CHAR column?

Yes! It is possible using MAX on a CHAR column.


5. Why SELECT is not preferred in Embedded SQL programs?

SELECT is not preferred in Embedded SQL programs for three reasons. First, if the table
structure is changed by the addition or deletion of a field and the program is modified, then using
SELECT might retrieve the columns that the user may not use. This would lead to Input-Output
overhead and the chances of index-only scan are also eliminated.

6. When is the LIKE statement used?

The LIKE statement is used to conduct partial searches such as the search of employees by name.
It is not necessary to indicate the complete name, partial string matches would do.

7. How is the value function used?

We can perform two tasks using the ‘value’ function:First, to avoid -ve SQLCODEs by handling
NULLs and 0s in the computation. Second, to substitute numeric values for NULLs used in the
computation

8. What are UNION and UNION ALL?

Both UNION and UNION ALL are used to combine the results generated by multiple SELECT
statements. UNION is the function that eliminates duplicates in the table. UNION ALL retains
the duplicates

9. Is there any restriction on the use of UNION in Embedded SQL?

While using UNION in Embedded SQL, it has to be in a CURSOR.

10. What do you mean by BETWEEN and IN? Is BETWEEN inclusive of specified range
values?

BETWEEN would supply a range of values, whereas IN would provide a list of values.
BETWEEN is always inclusive of the range values specified.

11. How can the FIRSTNAME and the LASTNAME from the EMP table be concatenated to
generate complete names?

The statement that can be used to concatenate the first and last names to display full
names:FIRSTNAME II ** II LASTNAME FROM EMP
12. What could be the reason that the MySQL statement 'SELECT AVG (SALARY) FROM
EMP' generates an inaccurate output?

The reason for the statement generating an inaccurate outcome is that SALARY has not been
declared to have NULL values and, at the same time, the employees whose salary is not known
are also counted.

13. What is a CURSOR and what is its use?

A CURSOR is a programming device that helps the SELECT statement find out a set of rows but
displays them one at a time. This is because the host language can deal with only one row at a
time.

14. How to retrieve rows from a DB2 table in Embedded SQL?

Rows from a DB2 table in Embedded SQL can be retrieved using the single-row SELECT
statement. Another way is by using the CURSOR statement. However, the first process is the
preferred one.

15. What is the result of the OPEN CURSOR statement?

In the simple OPEN CURSOR statement, the CURSOR is placed on the first row of a table. On
the other hand, when the ORDER BY clause is added, rows would be fetched, sorted, and would
be available for the FETCH statement.

16. Can there be more than one cursor open for any program?

Yes! The user can have more than one cursor open for any program.

17. How would the VARCHAR column REMARKS be defined?

The VARCHAR column REMARKS would be defined as follows:10 REMARKS;49


REMARKS-LEN PIC S9(4) USAGE COMP;49 REMARKS-TEXT PIC X(1920);

18. What is the physical storage length of each of the data types, DATE, TIME, and
TIMESTAMP?

The physical storage length of DATE is 4 bytes, TIME is 3 bytes, and TIMESTAMP is 10 bytes.

19. What is meant by DCLGEN?


DCLGEN refers to Declaration Generator that is used to create the host language copy books for
the table definitions. It also creates the DECLARE table.

20. What are the contents of DCLGEN?

DCLGEN has the EXEC SQL DECLARE TABLE statement that gives the layout of a table/view
in terms of DB2 data types. It can also be defined as the host language copy book giving the host
variable definitions for column names.

21. What are some of the main fields in SQLCA?

Major fields in SQLCA are SQLCODE, SQLERRM, and SQLERRD.

22. What is meant by EXPLAIN?

EXPLAIN is used for displaying the access path as determined by the optimizer for SQL
statements. It can also be used in the case of SPUFI for single SQL statements or in the BIND
step for Embedded SQL.

23. How to perform EXPLAIN for any Dynamic SQL statement?

Users can use SPUFI or QMF statements to perform EXPLAIN for Dynamic SQL statements.
They can also include the EXPLAIN command in the Embedded Dynamic SQL statements.

24. What are the isolation levels possible?

Two isolation levels are possible: One is Cursor Stability and the other is Repeatable Read
denoted as CS and RR, respectively.

25. What is the difference between CS and RR isolation levels?

CS would release the lock on the page after its use. RR would retain all the locks acquired till the
end of a transaction.

26. What is meant by Lock Escalation?

Lock escalation is the process of promoting page lock sizes to table or table space lock size when
the transaction has acquired more locks than the ones specified in NUMLKTS. Locks have to be
taken on objects in a single table space for escalations to take place.
27. What are the various types of Locks?

here are three different types of locks: SHARE, EXCLUSIVE, and UPDATE.

28. What is ALTER?

ALTER is the SQL command used to change the definition of DB2 objects.

29. What do you understand by DBRM and PLAN?

DBRM denotes Database Request Module. It has the SQL statements that are extracted from the
host language program obtained by the pre-compiler; PLAN is the result of the BIND process and
has executable code for SQL statements in DBRM.

30. What is meant by ACQUIRE/RELEASE in BIND?

ACQUIRE/RELEASE in BIND determines the point at which DB2 either acquires or releases
locks against the table and the table spaces. This includes the intent locks.

31. What is meant by PACKAGES?

PACKAGES contain executable codes for SQL statements in respect of one DBRM.

32. What are the advantages of using PACKAGES?

When used, PACKAGES help avoid binding of large numbers of DBRM members in one plan.
They also dispense with the cost of large BIND and avoid the entire transactions making them
unavailable during BIND and automatic REBIND of the plan. Another advantage is that they
minimize the fallback complexities when changes result in an error.

33. What is a collection?

A collection is a user-defined name that works as the anchor for packages but has no physical
existence. It is used for the grouping of packages.

34. What is Dynamic SQL?

Dynamic SQL is the SQL statement created at the time of the execution of a program.

35. What is the picture clause of Null Indicator variable?

S9(4) COMP is the picture clause of a null indicator.


36. Which component checks DB2 deadlocks?

Locking services are provided by Locking services component which is known as Internal
Resource Lock Manager (IRLM) and manages concurrency issues and dead locks.

37. Which component is responsible for execution of SQL statements?

Database services component is responsible for execution of SQL statements and it manages
buffer pool also.

38. Which component handles DB2 startup and shutdown?

System services component handles DB2 startup and shutdown.

39. On which level we can apply the locks?

Locking can be applied on either of these - Page, table and table space.

40. In which step we specify the isolation level?

In Bind step we specify the isolation level. 41. Which field in SQLCA shows the number of
updated rows after update statement?

Check the value of SQLERRD to know how many rows got updated after an update statement.

42. What is the physical storage length of TIMESTAMP data type?

TIMESTAMP data type takes 10 bytes and default is YYYY-MM-DD:HH:MM:SS-NNNNNN

43. What is the physical storage length of DATE data type?

DATE data types take 4 bytes and default is 'YYYY-MM-DD'

44. Which component is used to processes SQL statements and selects the access paths?

DB2 optimizer is used to select the access paths & to process the SQL queries.
45. In a COBOL-DB2 program all SQL statements must be coded in Area A. State whether true
or false?

This statement is incorrect as SQL statements must be coded in Area B.

46. Cursors are used to handle single row selections at a time. They are data structure which hold
all the results of a query. State whether true or false?

This statement is incorrect as cursors are used to handle multiple row selections at a time.

47. Host variables cannot be group items but they may be grouped together in host structure.
They can be Renamed or Redefined. State whether true or false?

This statement is incorrect as host variables cannot be renamed & redefined.

48. When a table is dropped all the alias get dropped automatically. State whether true or false?

This statement is incorrect. Synonyms get dropped automatically when we drop the table but alias
of the table remains there. We need to manually drop the alias.

49. What action DB2 takes when a program abends?

When a program abends in middle of some transaction then DB2 performs a auto rollback.

50. If a transaction takes a Update lock on some data, then other transactions can get what type of
lock?

If a transaction takes an Update lock on some data, then other transactions can only get only
Shared lock on it.

You might also like