- 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
What is a use of SQLWARN3 in a SQLCA? Explain with the help of a practical example?
The SQLWARN3 field in SQLCA is used to detect the condition wherein the number of the resultant columns is greater than the number of host variables given in the query of a COBOL-DB2 program. The SQLWARN3 is a 1 byte field, which contains the value ‘W’when there is mismatch in number of columns returned by the query and number of host variables used.
We can enquire the status of SQLWARN3 using IF or EVALUATE statements as in the below example
A010-CHECK-ORDER. EXEC SQL SELECT ORDER_DATE, ORDER_TOTAL INTO :ORDER-DATE, FROM ORDERS WHERE ORDER_ID = :ORDER-ID END-EXEC EVALUATE SQLWARN3 WHEN ‘W’ DISPLAY ‘MISMATCH IN COLUMNS & HOST VARIABLES’ WHEN OTHER DISPLAY ‘QUERY EXECUTED SUCCESSFULLY’
Advertisements