Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
ALLBASE/SQL COBOL Application Programming Guide: HP 9000 Computer Systems > Chapter 3 Embedding SQL Commands

Obtaining ALLBASE/SQL Messages

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

As shown at 10 in Figure 3-1 “Sample Program COBEX2 ”, you use the SQLEXPLAIN command to obtain a message from the ALLBASE/SQL message catalog that describes the condition related to certain SQLCA values:



        EXEC SQL SQLEXPLAIN :SQLMESSAGE END-EXEC.

ALLBASE/SQL puts a message from the ALLBASE/SQL message catalog into the host variable named SQLMESSAGE, and the program displays the message.

Sometimes more than one message may be needed to completely describe how an SQL command executed. To retrieve all messages, the program in Figure 3-1 “Sample Program COBEX2 ” executes paragraph S200-SQL-EXPLAIN until SQLCODE is equal to zero. ALLBASE/SQL sets SQLCODE to zero when no more messages are available.

You can use SQLEXPLAIN in conjunction with either implicit or explicit status checking. In the program in Figure 3-1 “Sample Program COBEX2 ”, the paragraph containing SQLEXPLAIN is executed in conjunction with the WHENEVER SQLERROR command.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.