
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 6705 Articles for Database

888 Views
When any COBOL-DB2 program is pre-compiled, the current timestamp is inserted in the DBRM and if the DBRM is binded to a package then the timestamp is further copied to a package. Similarly, the timestamp is also inserted in the load module during the compilation process.When any COBOL-DB2 program is executed, the system matches the timestamp of the load module with that in the DBRM/package, if there is mismatch then the program fails.In case DBRM directly binds to a plan, we need to bind both the plans - PLANA and PLANB again even if only the subprogram has gone through ... Read More

4K+ Views
A DBRM can be directly bound to a plan or we can first bind DBRM into a package and then bind that package into PLAN.In case DBRM binds to a plan directly, if there is some change in the source code, the new DBRM has to be generated and then we have to bind the entire plan again. Since, plan contains multiple DBRMs, the system will process all the DBRMs again in order to bind that plan (even if the other DBRMs have not gone through any changes). This process takes a lot of resources like memory, processor and valuable ... Read More

742 Views
A DBRM is a DB2 object which is generated from the pre-compilation of the source code. It contains all the SQL statements/queries of the source code. DBRM could not be executed directly due to its format, hence it is binded into a plan first. There can be multiple DBRM which can be binded in a single plan.Whenever there is a source code change, corresponding DBRM has to be generated again with changed SQL statements/queries. Then the entire plan (which contains the old DBRM) has to be bound again.Using the below JCL step we can BIND a DBRM directly into a ... Read More

5K+ Views
Precompilation is the process through which the SQL statements used in the COBOL-DB2 program are replaced by appropriate COBOL calls. The precompilation is necessary before the actual compilation because the COBOL compiler cannot recognize the DB2 SQL statements and will throw errors due to them.DB2 utility DSNHPC is used for the precompilation. The inputs to the precompilation JCL step are DCLGEN (in SYSLIB) for the respective tables which are used in COBOL-DB2 program and COBOL-DB2 source program (in SYSIN).//STEP010 EXEC PGM=IKJEFT01 //SYSIN DD DSN=DIS.TEST.COBOL(PSNEW2), DISP=SHR //SYSLIB DD DSN=DIS.TEST.DCLGEN(PSDC2), DISP=SHR //DBRMLIB DD DSN=DIS.TEST.DBRMLIB(PSNEW2), DISP=SHR //SYSCIN DD DSN=DIS.TEST.COBL(PSCOB2), DISP=(NEW, CATLG, DEL), SPACE=(20, ... Read More

2K+ Views
The package is a database object which contains the SQL statements from DBRM in a DB2-optimized form.The collection is a group of packages using which we can segregate the DB2 packages belonging to the different applications. For example, in a production environment for a Telecom company, we can have different collections for order handling, billing and customer service.The package or group of packages (collections) are binded into a plan. A plan is an executable object which contains the DB2 access paths of all the SQL queries within it. We can bind a package into a plan directly or we can ... Read More

4K+ Views
The COBOL-DB2 program can be executed with the help of IKJEFT01. The IKJEFT01 is an inbuilt mainframe utility that allows us to run z/OS TSO commands via Job control language(JCL). If we want to execute a COBOL-DB2 program PROGA of plan PLANA we must give a JCL step as below.//STEP010 EXEC PGM=IKJEFT01 //STEPLIB DD DSN=DIS.TEST.LOADLIB, DISP=SHR //SYSOUT DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(TB3) RUN PROGRAM (PROGA) PLAN(PLANA) END /*In the above JCL step, we have first used IKJEFT01 utility to call the COBOL-DB2 program. The loadlib path for the program PROGA is given in STEPLIB i.e. DIS.TEST.LOADLIB and the ... Read More

1K+ Views
In this problem, we are given a number n. Our task is to create a program to find the sum of the first and last digit of a number in PL/SQL.First, let’s brush-up about PL/SQL, PL/SQL is a combination of SQL along with the procedural features of programming languages.Let’s take an example to understand the problem, Input − n = 31415Output − 8Explanation − first digit = 3 , last digit = 5. Sum = 8To, solve this problem, we will extract the first and last digit to number n. And the print their sum.The first and last digits are ... Read More

742 Views
To aggregate multiple result, use $group in MongoDB. Let us create a collection with documents −> db.demo765.insertOne( ... ... { ... Name:"John", ... "Category":"ComputerScience", ... "SubjectName":"MongoDB", ... "Marks":75 ... } ... ); { "acknowledged" : true, "insertedId" : ObjectId("5eb054525637cd592b2a4b01") } > > db.demo765.insertOne( ... { ... Name:"John", ... "Category":"ComputerScience", ... "SubjectName":"MySQL", ... "Marks":85 ... } ... ); { "acknowledged" : true, "insertedId" : ObjectId("5eb054525637cd592b2a4b02") } > db.demo765.insertOne( ... ... Read More

791 Views
Use $ne to check for not null. Let us create a collection with documents −> db.demo764.insertOne({"LoginUserName":"Chris", "LoginPassword":"Chris_12"}); { "acknowledged" : true, "insertedId" : ObjectId("5eb04ee55637cd592b2a4afc") } > db.demo764.insertOne({"LoginUserName":"Chris", "LoginPassword":null}); { "acknowledged" : true, "insertedId" : ObjectId("5eb04eee5637cd592b2a4afd") } > db.demo764.insertOne({"LoginUserName":"Chris", "LoginPassword":""}); { "acknowledged" : true, "insertedId" : ObjectId("5eb04ef35637cd592b2a4afe") }Display all documents from a collection with the help of find() method −> db.demo764.find();This will produce the following output −{ "_id" : ObjectId("5eb04ee55637cd592b2a4afc"), "LoginUserName" : "Chris", "LoginPassword" : "Chris_12" } { "_id" : ObjectId("5eb04eee5637cd592b2a4afd"), "LoginUserName" : "Chris", "LoginPassword" : null } { "_id" : ObjectId("5eb04ef35637cd592b2a4afe"), "LoginUserName" : "Chris", ... Read More

1K+ Views
To query on an array of objects for nested documents, use find(). Let us create a collection with documents −> db.demo763.insertOne( ... { ... _id:1, ... CountryName:"US", ... "studentInformation": [ ... { ... StudentName:"Chris", ... }, ... { ... StudentName:"David", ... StudentAge:22 ... } ... ] ... } ... ); { "acknowledged" : true, "insertedId" : 1 }Display all documents from a collection with the help of find() method −> db.demo763.find();This will produce the following output −{ "_id" : 1, "CountryName" : "US", "studentInformation" : [ { "StudentName" : "Chris" }, { "StudentName" : "David", "StudentAge" : 22 } ] }Following is how to query an array of objects to fetch specific nested documents −> db.demo763.find({}, ... { ... studentInformation: { ... $elemMatch: { ... StudentAge: { ... $exists: true ... } ... } ... } ... })This will produce the following output −{ "_id" : 1, "studentInformation" : [ { "StudentName" : "David", "StudentAge" : 22 } ] }