DB2 Archive

Mainframes Common SQL/DB2 CODES and resolution

Mainframes Common SQL/DB2 CODES and resolution 180 to 189 date related 180 –> Invalid date format. 203 –> reference column is ambiguous.. IT NEEDS TO BE QUALIFIED AS IT EXISTS IN MULTIPLE TABLES. This Comes when same column name exists in multiple tables (or same table is being used multiple times in same SQL) which

Joins and Unions in DB2

Joins and Unions in db2 Unions and Joins, both are used to retrieve the data from multiple tables but are served for different purposes. JOIN – Joins typically used where the data required to select are spread across multiple tables that are dependent on each other. For Example EMPLOYEE and DEPT are two tables.Here Employee

Index Optimization Tips in DB2

Indexes are the data base objects which are stored physically on Disk, it contains the address of the actual data stored in tables that helps to retrieve the data quickly from the database. This can be considered as the ordered set of pointers which points to the data in actual table. These are created on

SQLDA Usage_Dynamic SQL

SQLDA USE in Dynamic SQL: Db2 uses the SQL Descriptor Area(SQLDA) to communicate the dynamic SQL information to the application program. It contains the various information like type of SQL, length, pointer to the actual data & number of columns etc. which are very useful for better coding. To get this information into SQLDA after

Dynamic SQL in DB2 COBOL

How to code Dynamic SQL(DS) in a COBOL DB2 Program Dynamic SQL is prepared and executed at the run time as opposed to embedding it in the host language program as in a static  one. Using dynamic SQL in the application programs has proved many advantages. For ex: In some cases the businesses requirement demands

DB2 Optimizer Overview | How Db2 selects the optimum path

The DB2 optimizer is the main component of DB2. As its name implies, it analyzes the SQL statements and determines the most efficient path to access the desired data from the tables. When the SQl statement is fired, it access the statistics stored in the DB2 catalog to determine the best path to suffice the

DB2 Table Space Types and its usage

Table Space concept in DB2: Table space is a database object where actually the table data gets stored. It is a like child of the database, where there can be multiple table spaces within a database. Each table space contains the ‘containers’. There can be one or more containers per table space. Containers can be

ESCAPE clause in SQL DB2

ESCAPE in DB2 Mainframes: In SQL the percent sign(%) and the under score(_) has special meaning. %’ – represents any set of characters _ – under score represents any single character. [crayon-5d2f161637372405903737/] This will display all the email ids starting with reddy like reddy123,reddy_34 etc. But here the requirement is to display the email ids

DB2 Group By and Order By Clauses

ORDER BY DB2 Order by clause is used to sort the result table values by the sort Key order. Here, sort key can be the column name or column number. Results can be sorted either by Ascending (ASC) or by Descending (DESC) order. ASC is the default order by clause. If you do not specify

DB2 Isolation Level details

In DB2 or in any Relational databases, the concurrency & data integrity is the key factor. Concurrency is the feature that makes multiple applications or users to access the resources at the same time without affecting each other’s work. Concurrency control is important as without the proper concurrency the applications may end with an invalid