Start of change

DSN8.GET_LINES stored procedure

The GET_LINES sample procedure returns one or more lines from the message buffer, and stores the text in an array.

Each line of text in the message buffer, up to, but not including the end-of-line character, is stored in an element of the target array.

Environment

The GET_LINES 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_LINES stored procedure
  • Ownership of the stored procedure
  • SYSADM authority

Syntax

Read syntax diagramSkip visual syntax diagram CALL DSN8.GET_LINES ( lines , numlines )

Option descriptions

lines
Lines of text from the message buffer. The CCSID of the result is 1200.

This is an output argument of user-defined type DSN8.GRPHICARR. DSN8.GRPHICARR is defined as:

VARGRAPHIC(16334) ARRAY[2147483647]
numlines
When numlines is used as an input argument, it specifies the number of lines to retrieve from the message buffer.

When numlines is used as an output argument, it specifies the number of lines that were retrieved from the message buffer. When the output value of numlines is less than the input value of numlines, the number of lines remaining in the message buffer is less than the requested number of lines.

If the input value of numlines is 0 or NULL, NULL is returned for lines, and 0 is returned for numlines.

This is an input and output argument of type INTEGER.

Notes

Creation of this procedure:
Sample job DSNTEJTR creates this procedure.

Examples

Example: Retrieve five lines from the message buffer into SQL variable LINES. Use SQL variable NUMLINES to specify that you want five lines, and to determine the number of lines that you receive.

CALL DSN8.GET_LINES(LINES,NUMLINES);
End of change