Start of change

DSN8.GET_LINE stored procedure

The GET_LINE sample procedure returns a single line from the message buffer, up to, but not including the end-of-line character sequence.

Environment

The GET_LINE stored procedure must be called from within a native SQL routine.

Authorization

To execute the CALL statement, the owner of the package or plan that contains the CALL statement must have one or more of the following privileges:

  • The EXECUTE privilege on the DSN8.GET_LINE stored procedure
  • Ownership of the stored procedure
  • SYSADM authority

Syntax

Read syntax diagramSkip visual syntax diagram CALL DSN8.GET_LINE ( line , status )

Option descriptions

line
A line from the message buffer. The CCSID of the result is 1200.

This is an output argument of type VARGRAPHIC(16334).

status
Indicates whether a line was returned from the message buffer. Possible values are:
0
A line was returned.
1
There was no line available to returned.

This is an output argument of type INTEGER.

Notes

Creation of this procedure:
Sample job DSNTEJTR creates this procedure.
Putting end-of-line character sequences in the message buffer:
You can put end-of-line character sequences in the message buffer in one of the following ways:
  • Use the PUT_LINE procedure to put each line in the message buffer with an end-of-line character sequence.
  • After a series of calls to the PUT procedure, call the NEW_LINE procedure.

Examples

Example: Retrieve a line from the message buffer into SQL variable LINE. Retrieve the status of the request into SQL variable STATUS.

CALL DSN8.GET_LINE(LINE,STATUS);
End of change