15.10 - Keep Response - Call-Level Interface Version 2

Teradata Call-Level Interface Version 2 Reference for Mainframe-Attached Systems

prodname
Call-Level Interface Version 2
vrm_release
15.10
category
Programming Reference
featnum
B035-2417-035K

Keep Response is a one-byte field that specifies whether Teradata Database is to keep the spool file after it sends the last parcel of the Teradata SQL response to the client.

Within an External Stored Procedure, a request initiated with the DBCAREA Return‑result‑to option, a Keep‑response setting of 'N' is not permitted. A setting of 'Y' indicates that the results are non-scrollable so are positioned to the next unfetched row, with fetched rows not propagated; while a setting of 'P' indicates that results are scrollable so the propagated results are positioned to the last row fetched, with earlier fetched rows also propagated.

If the procedure used a multi‑statement request (multiple SQL statements separated by semicolons) to return results, the response to each of these requests is reflected. If the procedure positioned to other than the first of these responses, the earlier ones are positioned beyond the end of their rows. While scrollable results may be repositioned to these earlier statement rows, non-scrollable results cannot.

 

In this language...

The variable name for Keep Response is...

COBOL

DBCAREA‑KEEP‑RESP

PL/I

KEEP_RESP

C

keep_resp

IBM Assembler

DBOKRSP

 

This routine...

Does this for Keep Response...

DBCHINI

writes

DBCHCL

reads (CON; RSUP; IRQ; IWPF; CMD)

 

Keep Response is used by...

To...

applications

write.

Keep Response is initialized by DBCHINI to the default value provided for Keep Response in the HSHSPB. When the value for Keep Response is not appropriate for the application, the application should perform the following procedure before calling DBCHCL for any of these functions:

  • RunStartUp
  • Initiate with Protocol‑Function
  • Command
  • Initiate Request
  • 1 Set Change Options to 'Y'.

    2 Change the value for Keep Response as follows.

     

    If the spool file is to...

    Then change the value for Keep Response to...

    be retained by the Teradata Database even after the last parcel of the Teradata SQL response has been sent to the client

    Y

    be discarded by the Teradata Database after the last parcel of the Teradata SQL response has been sent

    N

    retain both the SQL response parcels and their original row locations so that the client may reposition the response directly to particular rows using Positioning‑action

    P

    Use mnemonics for the codes. Mnemonics are provided in the language definition file for the DBCAREA.

    A call to DBCHCL for the Rewind function fails if Keep Response was N on the original request. Keep Response is not directly tied to Open Requests. Even if Keep Response is set to N and the last parcel has been sent so that the Teradata Database discards the spool file, Open Requests is not decremented.

    Applications must still call DBCHCL for the End Request function in order to decrement Open Requests and formally close the request, regardless of the setting of Keep Response, no matter how much of the response an application has been sent, and regardless of the actual state of the spool file.