Question:- What are some of the main fields in SQLCA?
Answer:- Major fields in SQLCA are SQLCODE, SQLERRM, and SQLERRD.
Question:- What is meant by EXPLAIN?
Answer:- 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.
Question:- How to perform EXPLAIN for any Dynamic SQL statement?
Answer:- 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.
Question:- What are the isolation levels possible?
Answer:- Two isolation levels are possible: One is Cursor Stability and the other is Repeatable Read denoted as CS and RR, respectively.
Question:- What is the difference between CS and RR isolation levels?
Answer:- CS would release the lock on the page after its use. RR would retain all the locks acquired till the end of a transaction.
Question:- What is meant by Lock Escalation?
Answer:- 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.
Question:- What are the various types of Locks?
Answer:- There are three different types of locks: SHARE, EXCLUSIVE, and UPDATE.
Question:- What is ALTER?
Answer:- ALTER is the SQL command used to change the definition of DB2 objects.
Question:- What do you understand by DBRM and PLAN?
Answer:- 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.
Question:- What is meant by ACQUIRE/RELEASE in BIND?
Answer:- 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.
Question:- What is meant by PACKAGES?
Answer:- PACKAGES contain executable codes for SQL statements in respect of one DBRM.
Question:- What are the advantages of using PACKAGES?
Answer:- 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.
Question:- What is a collection?
Answer:- 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.
Question:- What is Dynamic SQL?
Answer:- Dynamic SQL is the SQL statement created at the time of the execution of a program.
