IBM DB2 Interview Questions & Answers part 6

0
368
Q: – What is the difference between UNION and UNION ALL?

"UNION" eliminates duplicates but "UNION ALL" retains duplicates.

Q: – How is a schema used in DB2?

schemaname.tablename

Q: – Is DECLARE CURSOR executable?

No

Q: – What is a schema?

A schema is a high-level qualifier for database objects created within a database. It is a collection of database objects such as tables, views, indexes, or triggers. It provides a logical classification of database objects.

Q: – What is DCLGEN?

DCLGEN stands for declarations generator; it is a facility to generate DB2® database sql data structures in COBOL or PL/I programs.

Q: – How you will determine a table space's state?

db2 "list tablespaces show detail"

Q: – What is LOB ?

Large object (LOB) data types are used to store large amounts of unstructured data. Large object data types include the following:

Binary large object: The binary large object data type is used to store binary data values (such as documents, graphic images, pictures, audio, and video) that are up to 2 gigabytes in size. The keywords BINARY LARGE OBJECT and BLOB are used to denote the binary large object data type. The amount of storage space set aside to store a binary large object value is determined by the length specification provided when a binary large object data type is defined. For example, 800 bytes of storage space would be set aside for a BLOB(800) definition.

Character large object: The character large object data type is used to store SBCS (single-byte character set) or MBCS (multibyte character set)character string values that are between 32,700 and 2,147,483,647 characters in length. The keywords CHARACTER LARGE OBJECT, CHAR LARGE OBJECT, and CLOB are used to denote the character large object data type. The amount of storage space set aside to store a character large object value is determined by the length specification provided when a character large object data type is defined. For example, 800 bytes of storage space would be set aside for a CLOB(800) definition.

Double-byte character large object: The double-byte character large object data type is used to store DBCS (double-byte character set) character string values that are between 16,350 and 1,073,741,823 characters in length. The keyword DBCLOB is used to denote the double-byte character large object data type. The amount of storage space set aside to store a double-byte character large object value is determined by the length specification provided when a double-byte character large object data type is defined. For example, 800 bytes of storage space would be set aside for a DBCLOB(400) definition.

Q: – What is a cursor? Why should it be used?

Cursor is a programming device that allows the SELECT to find a set of rows but return them one at a time. Cursor should be used because the host language can deal with only one row at a time.

Submitted By:-Vikas            Email-ID: – vikas123.singh@yahoo.com

SHARE

LEAVE A REPLY