The package provides following advantages: Modularity Easy to design the applications Better performance Hiding information Added functionality Overloading
DB2 Interview Questions
EXEC SQL DECLARE TABLE statement which gives the layout of the table in terms of DB2 data type. A host language copy book that gives the host variable definitions for the column name.
DCLGEN is stands for DeCLarations GENErator. It is used to create the host language copy books for the table definitions. It also creates the DECLARE table.
DATE: PIC X(10) TIME PIC X(08) TIMESTAMP PIC X(26)
If you use the OPEN CURSOR command with ORDER BY clause, the rows are fetched, sorted and made available for the FETCH statement. Otherwise simply the cursor is placed on the first row.
There are three reasons for not using SELECT * in embedded SQL programs: If you change the table structure i.e. adding a field, the program will have to be modified. Program can retrieve the columns which it might not use, leading an I/O overhead. The chance of an index only scan is lost.
Cursor stability ensures that any row that has been changed by activation group with a dissimilar commitment definition cannot be read before committing.
In DB2, a role is an object of database that group various privileges together and can be assigned to groups or user by GRANT statement.
SPUFI stands for SQL Processor Using File Input.
The maximum size of a VARCHAR data type in DB2 is 4046 bytes.