Mandalika has Published 475 Articles

What is the execution result when a DB2 program is compiled and binded on separate days?

Mandalika

Mandalika

Updated on 01-Dec-2020 05:02:19

111 Views

Problem: The DB2 program PROGA was changed and compiled, but it was binded after 3 days. What will happen if we execute this program on the 4th day?SolutionThe pre-compiler inserts the current timestamp in the modified source code and in DBRM. In case of modified source code, this timestamp is ... Read More

What is the panel command to display all DB2 database components?

Mandalika

Mandalika

Updated on 01-Dec-2020 05:01:29

133 Views

Problem: Give and explain the panel command to display all the components of DB2 database DSNDB01 along with their status.SolutionA DB2 is a relational database which can be visualized to have both physical as well as logical structures. The physical structure contains components like log files, bufferpools, control files etc. ... Read More

How to bind multiple versions of a DB2 program into a package?

Mandalika

Mandalika

Updated on 01-Dec-2020 04:58:10

501 Views

Packages are DB2 database objects which hold the executable forms of SQLs which are used in COBOL-DB2 programs. The packages are stored in a catalog table and contain the strategy/tables/columns/predicate associated with the SQL statements.If there is a DB2 table ORDERS_TEST in test environment and ORDERS_PROD in production environment, then ... Read More

What will be the result if there is a timestamp mismatch in the DBRM and Load module?

Mandalika

Mandalika

Updated on 01-Dec-2020 04:57:26

510 Views

When the COBOL-DB2 source code is given as an input in the pre-compilation stage, we get 2 important components — DBRM and modified source code.In modified source code, the SQL statements are replaced by COBOL calls and the DBRM contains all the SQL statements which are present in the COBOL-DB2 ... Read More

Explain the concept of integrity in DB2 along with types of integrity

Mandalika

Mandalika

Updated on 01-Dec-2020 04:53:43

455 Views

Problem: What is INTEGRITY in a DB2? Explain DOMAIN, ENTITY and REFERENTIAL integrity with the help of an example in ORDERS table.SolutionThe integrity refers to the accuracy, consistency and correctness of data present in the DB2 database. Data integrity is imposed during the database design to make sure that data ... Read More

Write a DB2 query to find out all the duplicate INVOICE_ID in ORDERS DB2 table?

Mandalika

Mandalika

Updated on 01-Dec-2020 04:51:10

552 Views

The duplicate INVOICE_ID in ORDERS DB2 table can be found by using a combination of GROUP BY with HAVING clause and COUNT function. The GROUP BY will enable us to group the result invoice wise and COUNT function will enable us to count the number of occurrences in each group. ... Read More

Example of SQL query describing COUNT function and GROUP BY

Mandalika

Mandalika

Updated on 01-Dec-2020 04:49:56

144 Views

Problem: Write a query on TRANSACTIONS DB2 table to list down the number of orders (ORDER_ID) assigned to a particular transaction (TRANSACTION_ID).SolutionWe can use the below query to find out the number of orders assigned to a particular transaction id on TRANSACTIONS DB2 table.ExampleSELECT TRANSACTION_ID, COUNT(ORDER_ID) FROM TRANSACTIONS    GROUP ... Read More

What is -551 error code in DB2? How will you resolve it?

Mandalika

Mandalika

Updated on 01-Dec-2020 04:48:36

3K+ Views

When we get -551 in the SQLCODE then there is some privilege level issue. It signifies that the user does not have access to the database/tablespace/view/table that he is trying to access. As per the IBM documentation -551 SQLCODE states that.Example-551 auth-id DOES NOT HAVE THE PRIVILEGE TO PERFORM OPERATION ... Read More

What are QMF and SPUFI? What is the difference between them for accessing DB2 tables?

Mandalika

Mandalika

Updated on 01-Dec-2020 04:47:26

1K+ Views

Both QMF and SPUFI are tools built to access DB2 databases in a mainframe environment. Using these tools, we can SELECT, UPDATE and DELETE the data from the DB2 database. QMF stands for Query Management Facility and SPUFI stands for SQL Processor Using File Input.Below are the differences between QMF ... Read More

What is the purpose of OPTIMIZE FOR ROWS in DB2 SQLs? How is it useful?

Mandalika

Mandalika

Updated on 01-Dec-2020 04:46:23

679 Views

The OPTIMIZE FOR N ROWS is a DB2 clause which we can add in the query to give priority for the retrieval of the first few rows only. This clause will enable the optimizer to choose the access path that minimizes the response time for fetching first few rows.The OPTIMIZE ... Read More

Previous 1 ... 3 4 5 6 7 ... 48 Next
Advertisements