PRPSQLSTT command (X'200D')

The distributed data management (DDM) architecture Prepare SQL Statement command (PRPSQLSTT) dynamically binds a SQL statement to a section in an existing database (RDB) package.

Format

Read syntax diagramSkip visual syntax diagramDSSHDRLLCPSQLSTTGRP

Parameters

DSSHDR
The 6-byte header field containing information about the DSS.
LL
A 2-byte field that has the length of the PRPSQLSTT command.
CP(X'200D')
The 2-byte codepoint of the PRPSQLSTT command.
PKGNAMCSN(X'2113')
Specifies the fully qualified package name, consistency token, and section number within the package that is used to execute the SQL. The PKGNAMCSN can have one of the following formats, depending on the length of the RDBNAM, RDBCOLID, and PKGID contained therein:
  • RDBNAM, RDBCOLID, and PKGID each have a length of 18. This format of the PKGNAMCSN is identical to the sole format used before DDM Level 7, where the length is fixed at 68. The use of the SCLDTALEN is disallowed with this format.
  • At least one of RDBNAM, RDBCOLID, or PKGID has a length > 18. This format of the PKGNAMCSN requires the SCLDTALEN precedes each of the RDBNAM, RDBCOLID, and PKGID. With this format, the PKGNAMCSN has a minimum length of 75 and a maximum length of 785.

Format:

Read syntax diagramSkip visual syntax diagramLLCPSCLDTALEN RDBNAMSCLDTALENPKGID PKGNAM PKGCNSTKNPKGSN SCLDTALENRDBCOLID

Parameters:

RDBNAM
An 18- to 255-byte character field that represents the relational database name.
PKGID
An 18- to 255-byte character field that represents the relational database package identifier.
PKGNAM
An 18- to 255-byte character field that specifies the fully qualified name of a relational database package.
PKGCNSTKN
An 8-byte character field that verifies that the requester’s application and the relational database package are synchronized. Mutually exclusive with PKGSN.
PKGSN
A 2-byte short field that represents the Section Number. Mutually exclusive with PKGCNSTKN.
SCLDTALEN
Specifies the length of the instance variable that immediately follows:
  • RDB collection identifier (RDBCOLID)
  • Relational database name (RDBNAM)
  • RDB package identifier (PKGID)
This token is allowed only when the length of one or more of the parameters listed is greater than 18 bytes.
Note: If the length of any one of RDBNAM, RDBCOLID, or PKGID exceeds 18 bytes, the SCLDTALEN is mandatory and must precede each of the three parameters RDBNAM, RDBCOLID, and PKGID. Otherwise, the SCLDTALEN is disallowed.
RDBCOLID
An 18- to 255-byte character field that identifies a unique collection of objects that are contained in a relational database. It is used for user-defined grouping.
RTNSQLDA(X'2116')
Return SQL Descriptor Area controls whether to return an SQL descriptor area that applies to the SQL statement this command identifies. The target SQLAM obtains the SQL descriptor area by performing an SQL DESCRIBE function on the statement after the statement has been prepared.
Read syntax diagramSkip visual syntax diagramLLCPVALUE

Parameters:

VALUE
TRUE (X'F1') – Indicates an SQLIMSDA is returned.
FALSE (X'F0') – Indicates an SQLIMSDA is not returned.
Note: IMS will always send a 0x'01' from the Universal Driver.
TYPSQLDA(X'2146')
Type of SQL Descriptor Area.
Read syntax diagramSkip visual syntax diagramLLCPTYPE

Parameters:

TYPE
A single-byte signed number that specifies the type of SQLIMSDA to return for the command.
0
Standard output SQLIMSDA. This type is supported for ODBM.
1
Standard input SQLIMSDA. This type is supported for ODBM.
2
Light output SQLIMSDA
3
Light input SQLIMSDA
4
Extended output SQLIMSDA
5
Extended input SQLIMSDA
MONITOR(X'1900')
Read syntax diagramSkip visual syntax diagramLLCPFLAGS
FLAGS
A 4-byte flag value.

PRPSQLSTT examples

The following example shows PRPSQLSTT that is part of the request to an OPNQRY call.

[ibm][ims][drda][t4]        SEND BUFFER: PRPSQLSTT              (ASCII)           (EBCDIC)
[ibm][ims][drda][t4] 0000   0058D05100020052  200D004421134BC9  .X.Q...R ..D!.K.  ..}............I
[ibm][ims][drda][t4] 0010   D4E2F14040404040  4040404040404040  ...@@@@@@@@@@@@@  MS1             
[ibm][ims][drda][t4] 0020   D5E4D3D3C9C44040  4040404040404040  ......@@@@@@@@@@  NULLID          
[ibm][ims][drda][t4] 0030   4040E2E8E2E2D5F2  F0F0404040404040  @@........@@@@@@    SYSSN200      
[ibm][ims][drda][t4] 0040   404040405359534C  564C303100010005  @@@@SYSLVL01....      ...<.<......
[ibm][ims][drda][t4] 0050   2116F10005214604                    !....!F.          ..1.....