SQL Programming Manual for TAL
System Procedures
HP NonStop SQL Programming Manual for TAL—527887-001
4-18
SQLCATOBUFFER
suffix^len input
INT
specifies the length of the suffix string to append to each output line; the length can
be an integer value from 1 through 15. If you include the suffix parameter, you
must also include this parameter. If you omit the suffix parameter, you must also
omit this parameter.
Guidelines
Follow these guidelines when you call the SQLCATOBUFFER procedure:
•
NonStop SQL returns errors as negative numbers and warnings as positive
numbers.
•
If there is no text for an error number, NonStop SQL displays:
No error text found.
The $SYSTEM.SYSTEM.SQLMSG file contains the error text for SQL messages.
If you receive this message, your version of the SQLMSG file might not match the
version of the SQL executor.
•
SQLCATOBUFFER works by starting with the first^record^number indicated to
move output lines to the record area until all error messages are moved or until the
text fills the record area. SQLCATOBUFFER returns to output^records a count of
the lines moved to the buffer. If an overflow occurs, the procedure sets the more
flag to Y.
•
On an overflow condition, your program can retrieve the rest of the error message
text by calling SQLCATOBUFFER again, setting first^output^record to
output^records + 1.
This example uses a 75-character output record and a buffer of 375 characters. The
example also declares an SQLMSG file number, which it initializes to -1. The
SQLCATOBUFFER call returns the SQLMSG file number so that it can be used in
subsequent calls.
CALL SQLCATOBUFFER ( sqlca, ! SQLCA structure
msg^buf, ! Message buffer
375, ! Buffer length
,,, ! Omitted
75, ! output record size
sqlmsg^file); ! SQLMSG file number










