Mandalika has Published 470 Articles

What is a malloc function in C language?

Mandalika

Mandalika

Updated on 20-Feb-2021 10:27:42

7K+ Views

The malloc() function stands for memory allocation, that allocate a block of memory dynamically.It reserves the memory space for a specified size and returns the null pointer, which points to the memory location.malloc() function carries garbage value. The pointer returned is of type void.The syntax for malloc() function is as ... Read More

What is Evaluation, Precedence and Association in C language?

Mandalika

Mandalika

Updated on 20-Feb-2021 05:17:24

4K+ Views

Expressions are evaluated by the ‘C’ compiler based on precedence and associativity rules.If an expression contains different priority operators, then the precedence rules are considered.Here, 10*2 is evaluated first since ‘*’ has more priority than ‘- ‘and ‘=’If an expression contains same priority, then associativity rules are considered i.e. left ... Read More

What is COBOL host variable equivalent for various DB2 data types?

Mandalika

Mandalika

Updated on 01-Dec-2020 05:07:03

1K+ Views

Problem: How will the COBOL-DB2 program behave when there is a mismatch between the host variable and number of columns in the SELECT statement?SolutionIn case there is a mismatch in the number of columns and number of host variables, the query will fail. For example, if we have used the ... Read More

What is the purpose and usage of “FOR UPDATE OF” clause in a COBOL-DB2 program

Mandalika

Mandalika

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

5K+ Views

Problem: What is the purpose of the "FOR UPDATE OF" clause in a cursor? What will happen if we fire an UPDATE statement without using this clause in a COBOL-DB2 program?SolutionThe “FOR UPDATE OF” clause is given in the cursor declaration and it is used when we want to update ... Read More

What is update operation on the cursor having JOIN between 2 tables?

Mandalika

Mandalika

Updated on 01-Dec-2020 05:04:28

747 Views

Problem: Is it possible to update a CURSOR in which we have used JOIN on 2 tables ORDERS and TRANSACTIONS? Why or why not? How can we proceed to UPDATE any of these tables?SolutionWhenever we use JOIN in a cursor on two or more tables (ORDERS and TRANSACTIONS in this ... Read More

What is the execution result when non-SQL changes are made in the program without BIND?

Mandalika

Mandalika

Updated on 01-Dec-2020 05:03:14

239 Views

Problem: A COBOL-DB2 program is changed to increase the length of a variable from PIC X(5) to PIC X(8). However, there are no changes in the SQL of the program. What will be the result if the program's plan/package is not binded for these changes?SolutionThe variable length change from PIC ... Read More

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

244 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

195 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

872 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

881 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

Advertisements