When you use COMMIT or ROLLBACK statements with CURSOR, the behavior of the CURSOR depends on whether or not it is declared using the WITH…
When processing a CURSOR, DB2 SQL give option to update or delete data in base table based on current position of CURSOR in result table.…
A scrollable cursor is one defined with the SCROLL keyword. A scrollable cursor can move in both forward and backward directions. For a scrollable cursor,…
SERIAL CURSOR : A serial cursor is one defined without the SCROLL keyword. A serial cursor can only more in forward direction. For a serial…
SQL CURSORS Result Set of a SELECT Statement which returns more than one row is easy to view on SQL interface like STRSQL. But How…
SUBQUERIES SQL SubQuery is a query which inside another query. You can include a subquery in a WHERE or HAVING clause by using a basic…
GLOBAL VARIABLES GLOBAL VARIABLES are database objects to save a single value at a time(like DTAARA object) They can be accessed and modified using SQL…
COMMON TABLE EXPRESSION (CTE) Unlike NESTED TABLE EXPRESSION CTE is not specified in FROM clause of the query. But CTE is specified before the full-select…
Nested table expressions(NTE) (also called derived tables) Basic syntax of SQL SELECT statement is like SELECT * FROM table-name Nested table expressions gives you option…
SQL TABLE EXPRESSION SQL TABLE EXPRESSION gives you power to create a temporary table inside a query. Life of this temporary table is only inside…
Global Temporary Table DECLARE GLOBAL TEMPORARY TABLE gives you a handy option to create table in QTEMP lib with some very useful options. As DECLARE…
Materialized Query Table(MQT) A materialized query table is a table whose structure and definition is based on the result of a given query. Materialized query…
SQL SEQUENCE OBJECT SEQUENCE OBJECT are similar to IDENTITY COLUMN in the way that they both generate unique values and use almost same attributes. However,…
Using ROWID is another way to have the system assign a unique value to a column. ROWID is similar to IDENTITY COLUMNS. But rather than…
IDENTITY COLUMN An IDENTITY COLUMN is a numeric column defined in a table for which the column values can be generated automatically by DB2. Only…