- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use SQLCA in a COBOL-DB2 program? What is the purpose of SQLCA?
SQLCA stands for SQL-Communication Area. It is a medium through which DB2 can communicate with the COBOL program. In a typical COBOL-DB2 program, there are many SQL statements used. The main purpose of SQLCA is to inform the COBOL program about the status and other details of the most recently executed SQL query.
The SQLCA has a total length of 136 bytes and it is composed of various fields like SQLCODE, SQLERRD, SQLWARN, etc. Each of these fields give specific details of the last executed SQL query.
For example, SQLCODE returns the DB2 error code (if any), SQLWARN returns the warning issued while executing SQL statements.
The SQLCA is declared in COBOL working storage area with INCLUDE statement as below−
EXEC SQL INCLUDE SQLCA END-EXEC
Advertisements