SAP HANA SQL Command Network Protocol Reference en
SAP HANA SQL Command Network Protocol Reference en
2 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1 Terminology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Protocol Modification. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 Message Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8
3.1 Message Header. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Segment Header. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Segment Kind. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Message Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Command Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Function Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.3 Part Header. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Part Kind. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Part Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.4 Part Support in Request Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5 Part Support in Reply Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.6 Type Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.7 Part Data Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Option Part Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Multi-Line Option Part Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
COMMAND. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
RESULTSET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
ERROR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
STATEMENTID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
TRANSACTIONID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
ROWSAFFECTED. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
RESULTSETID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24
TOPOLOGYINFORMATION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
TABLELOCATION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
READLOBREQUEST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
READLOBREPLY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
ABAPISTREAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
ABAPOSTREAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
COMMANDINFO. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
WRITELOBREQUEST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4 Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
This guide describes the SQL Command Network Protocol that is used by SAP HANA clients to communicate
with SAP HANA.
This document describes the SQL Command Network Protocol of the SAP HANA database, the protocol used
by SAP HANA database clients to communicate with the SAP HANA database.
This document describes the binary message format used in the communication, and explains the purpose of
the various protocol elements. It also discusses usage scenarios for the various messages defined in the SQL
Command Network Protocol and defines usage sequences to utilize database server functionality, such as:
2.1 Terminology
A message describes requests or replies exchanged between client and server. A request is always a message
sent by the client, and a reply is always the message sent by the server.
The following abbreviations are used to describe data types in message formats:
Table 1:
Abbreviation Data Type C Data Type1
NUI8 8-byte unsigned integer in client native (big/little-endian) format unsigned long
FLOAT IEEE single precision floating point value in little-endian format float
DOUBLE IEEE double precision floating point value in little-endian format double
Additions to the protocol require careful modification and extension of the exchanged connect options.
The SQL Command Network Protocol must be kept stable so that clients are able to communicate with recent
version server software, and vice versa. A more recent client may have to degrade the usage of the protocol
depending on the server version, and a more recent server may have to use only certain features if non-recent
client software is detected.
Detection is performed during connection by exchanging connect options, which specify the required behavior
of the client, and getting the supported feature set from the server. This detection does not perform global
versioning, but enables or disables feature flags, or modifies certain functionality.
The communication between client and server is completely synchronous: the client can only send the next
request once the reply to the previous request has been fully received.
A client is free to continue with its own processing, or communicate with other servers of a SAP HANA
database system while waiting for the answer.
A message consists of a fixed part, called the message header and a variable length message buffer. The
message buffer contains message segments, which, in turn, consist of a segment header and a segment
buffer. The segment buffer contains parts, and the parts have a fixed length part header and a variable length
buffer.
There is one exception to this format: during communication initialization, a different message pair is
exchanged that is necessary to distinguish the current and former protocol variants.
The message header is a 32 byte structure that consists of the following fields:
Table 2:
Field Data Type Description
PACKETCOUNT I4 A packet sequence number in this session. Packets with the same sequence
number belong to one request/response pair.
VARPARTLENGTH UI4 The amount of space used in the packet. The maximum size is 2G -1.
VARPARTSIZE UI4 The total amount of space in the packet. The maximum size is 2G -1.
The segment header has a length of 24 bytes. There are different segment header structures for request and
reply, but both have the same definition for first 13-bytes of the structure. They are structured as follows:
Table 3:
Table 4:
Table 5:
Field Data Type Description
SEGMENTKIND I1 The segment kind, which further specifies the layout of the remaining seg
ment header structure.
COMMANDOPTIONS I1 A bit set that defines specific options for the sent message.
FUNCTIONCODE I2 A value that defines the nature of the statement or functionality that has
been prepared or executed.
The segment kind field is the last field of the segment header part, common to all types (kinds) of segments. It
defines the segment kind, which further specifies the layout of the remaining segment header structure.
Table 6:
Value Description
1 A request segment.
2 A reply segment.
The message type defines the action requested from the database server.
Table 7:
Value Identifier Description
72 FETCHABSOLUTE Moves the cursor to the given row number and fetches the data.
73 FETCHRELATIVE Moves the cursor a number of rows relative to the position, either positive or
negative, and fetches the data.
74 FETCHFIRST Moves the cursor to the first row and fetches the data.
75 FETCHLAST Moves the cursor to the last row and fetches the data.
79 FETCHNEXTITAB Fetches the next result for an ITAB object in Fast Data Access mode.
80 INSERTNEXTITAB Inserts the next result for an ITAB object in Fast Data Access mode.
The command options field is a bit set that allows specific options for the sent message to be defined.
Table 8:
Bit Identifier Description
3 HOLD_CURSORS_OVER_COMMIT Keeps the result set created by this command over commit time.
5 SCROLL_INSENSITIVE Marks the result set created by this command as scroll insensitive.
The function code identifies the nature of the statement or functionality that has been prepared or executed.
Table 9:
Value Identifier Description
Table 10:
Field Data Description
Type
BUFFERLENGTH I4 Specifies the length of the part buffer in bytes (used space).
Related Information
The part kind field is the first section of the part header.
Table 11:
Value Identifier Description
The part attributes make up a bit set to indicate special features of a certain part.
Table 12:
Bit Identifier Description
In the following table, letters denote the relationship between the part and the message:
A This part can always be sent if distributed transaction handling requires it.
In the following table, the letters denote the relationship between the part and the message:
D Always if the statement caused an action in transaction handling (commit, rollback, or start of a new write
transaction)
E Available if the server has information useful to applying statement routing (see the corresponding Usage
Scenario Statement Routing).
I Supported when the parameter metadata has changed due to schema changes.
Type codes identify the type of a field transferred from or to the database.
Not all type codes known and processed internally are used in the protocol, and clients may support a different
level of type support depending on their version. The protocol mechanism (connect options) for connecting to
the database ensures that the client sends the server data it is able to process, and that the client receives
only data it can process from the server.
Type codes are in the range of 0-127, as the most significant bit is used on input to signal a NULL value of a
certain type.
Table 13:
Value Identifier Description Support Level
1 TINYINT TINYINT 1
2 SMALLINT SMALLINT 1
3 INT INTEGER 1
4 BIGINT BIGINT 1
6 REAL REAL 1
7 DOUBLE DOUBLE 1
8 CHAR CHAR 1
9 VARCHAR VARCHAR 1
12 BINARY BINARY 1
13 VARBINARY VARBINARY 1
28 BOOLEAN BOOLEAN 7
35 VARCHAR2 VARCHAR -
36 VARCHAR3 VARCHAR -
37 NVARCHAR3 NVARCHAR -
38 VARBINARY3 VARBINARY -
50 ARRAY ARRAY 7
This section describes the format of parts transmitted in messages between the client and the database
server.
The format of the data transmitted is uniquely identified by the part kind, some part kinds share the same
format as the contained data.
The option part format is a common format to transmit options, that is, typed key-value pairs.
Table 14:
Field Data Type Description
Table 15:
Type Code Value Format
STRING 2-byte signed integer (short ) length information, little-endian format, followed by the string in
CESU-8 encoding (number of bytes is specified by length information)
BSTRING 2-byte signed integer (short ) length information, little-endian format, followed by the binary
string (number of bytes is specified by length information)
The multi-line option part format is a common format to transmit collections of options (typed key-value
pairs).
An option part contains rows having the following structure. The number of rows is the part argument count
value.
Table 16:
Field Data Type Description
Different rows can have a different argument count, so the format is not completely tabular.
3.7.3 COMMAND
The COMMAND part contains the text of an SQL command. The text is always encoded in CESU-8 encoding.
The fields of the individual rows are formatted as defined in the output field format section. One result set part
contains as many rows as the argument count field indicates:
Note that the field values may have variable lengths, depending on the data type. Therefore, all the values in
the current row must be scanned before moving to the next row.
3.7.5 ERROR
An ERROR part contains one or more errors returned by the database server to the client. The error part
contains elements having the following structure:
Table 17:
Field Data Type Description
SQLSTATE B[5] SQLSTATE as defined by the SQL standard for this message
The error level defines the level of the message – warning, error, or fatal session-terminating error -- using the
following values:
Table 18:
Value Identifier Description
1 ERROR Error message, this statement (or part of it) has failed
3.7.6 STATEMENTID
A STATEMENTID part contains a statement identifier, which is a byte array of 8-bytes in length. The statement
identifier is opaque to the client program.
3.7.7 TRANSACTIONID
A TRANSACTIONID part contains the identifier of a transaction, which is a byte array of variable length, and
stored in the same way as a VARBINARY output value. The transaction identifier is opaque to the client
program.
3.7.8 ROWSAFFECTED
A ROWSAFFECTED part contains one or multiple (as many as the part’s ARGUMENTCOUNT field defines) 32-
bit integers, which indicate the number of rows affected by a statement, or a row of an array command.
Table 19:
Value Identifier Description
-2 SUCCESS_NO_INFO Statement/row has been processed but number of affected rows cannot be
determined.
3.7.9 RESULTSETID
A RESULTSETID part contains the identifier of a result set, which is a byte array of 8-bytes in length. The result
set identifier is opaque to the client program.
Table 20:
Value Identifier Data Type Description
B Externally-visible IP address/name in SAP HANA SPS 06, internal host name in previous SAP HANA
revisions
HOSTNAME
This field contains the host name of the server, without any domain part, for SAP HANA revisions before SPS
06.
Beginning with SAP HANA SPS 06, this is the externally visible TCP/IP address of the server.
This field contains the port number of the SQL port of the server.
TENANTNAME
LOADFACTOR
This field contains a factor used when distributing workload among servers. A load factor of 1.0 is the default
value.
VOLUMEID
This field contains the volume ID of the data volume managed by this server, or 0 if there is no data volume
attached yet (as in case with a standby server).
ISMASTER
This field contains a 1 (true), if the server is the master server of the SAP HANA database system.
ISCURRENTSESSION
This field contains a 1 (true), if the server that manages the session has returned this topology information.
NETWORKDOMAIN
This field contains the network domain of the server, if a non-empty domain is defined. Beginning with SAP
HANA SPS 06, this field is not sent to the client.
ALLIPADDRESSES
This field contains a comma-separated list of the TCP/IP addresses assigned to this node. Beginning with SAP
HANA SPS 06, this field is not sent to the client.
ALLHOSTNAMES
This field contains a comma-separated list of all host names assigned to this node. Beginning with SAP HANA
SPS 06, this field is not sent to the client.
3.7.11 TABLELOCATION
A table location part contains one or multiple 4-byte integers in little-endian format, which identify the data
volume IDs.
The number of elements is the argument count of the part. The returned volume IDs signal preferred execution
locations for the statement, and depend on the:
● Nature of the SQL command that is prepared (some commands can only be executed on a certain server)
● Number of partitions of the tables affected by the statement
● Location of the tables affected by the statement
3.7.12 READLOBREQUEST
A read LOB request part is sent by the client to request BLOB/CLOB/NCLOB data to be read.
Table 21:
Field Data Type Description
For byte-based large object types, the READOFFSET and READLENGTH define byte positions and length
values, for character-based large object types, these fields define character positions and length values within
the large object.
3.7.13 READLOBREPLY
The READLOBREPLY part is sent from the database as answer to a read LOB request of the client.
Table 22:
Field Data Type Description
The OPTIONS field is a bit set which has the following defined values:
Table 23:
Bit Identifier Description
0 NULLINDICATOR The large object value is NULL (not used for READLOBREPLY).
3.7.14 ABAPISTREAM
An ABAPISTREAM part is sent from the database requesting an ABAP input stream for C++ procedure
processing, and as a response from the client when sending the stream data.
Table 24:
Field Data Type Description
MASK B[…] Bit field to mask entries of the ABAP table do not transfer them
The MASK field may be omitted completely. In this case, all columns of the ABAP table are transferred.
Otherwise, only the marked values are transferred, enabling a projection of the ABAP table in the server
processing. The number of rows requested is supplied in the argument count of the ABAPISTREAM part. In the
case that the client sends this part to identify stream data transmitted to the database server, only the
ABAPTABID field is used.
3.7.15 ABAPOSTREAM
The ABAPOSTREAM part contains one 4-byte integer value identifying the ABAPTABID of the table, whose
data is sent in the corresponding STREAMDATA part.
3.7.16 COMMANDINFO
Table 25:
Value Identifier Data Type Description
This part is used to identify the location of a statement in the source program for debugging and analysis
purposes.
3.7.17 WRITELOBREQUEST
The WRITELOBREQUEST part is sent from the client to write data piece-wise into a large object.
Table 26:
Field Data Type Description
WRITEOFFSET I8 Offset within the large object data, an offset of -1 request ap
pending the data to the already existing large object data
A number of large objects may be written using this request. The argument count of the part describes how
many elements are contained in the part.
The OPTIONS field is a bit set which has the following defined values:
Table 27:
Bit Identifier Description
0 NULLINDICATOR The large object value is NULL (not used for WRITELOBREQUEST).
3.7.18 WRITELOBREPLY
The WRITELOBREPLY part is sent as reply from the server to a WRITELOBREQUEST part.
It contains the LOCATORID identifiers for all large object locators which can still receive data (if LASTDATA
has not been set). The argument count defines the number of locator identifiers contained in the data.
3.7.19 PARAMETERS
The parameters are densely packed, and use the input field format. The argument count of the part defines
how many rows of parameters are included.
Related Information
Table 28:
Field Data Type Description
Table 29:
Field Data Type Description
Table 30:
Field Data Type Description
The initial request contains the database user name, and field pairs (method name/value) for each
authentication method requested by the client.
Table 31:
Method Name Description
Additional Requests
Requests, following the initial request, contain a number of field pairs for authentication methods, which are
performed by exchanging messages.
3.7.21 SESSIONCONTEXT
Table 32:
Value Identifier Data Type Description
The primary connection is the first connection opened by the client program to the system in a distributed
scenario. The master connection is the connection that started the current distributed transaction.
Table 33:
Value Identifier Data Type Description
This part is populated from previously received statement context information. The binary option content is
opaque to the client application.
3.7.23 PARTITIONINFORMATION
The PARTITIONINFORMATION part is returned by the server to allow a more specific pruning of input data, as
it pertains to the partitioning of data in the database server.
Table 34:
Field Data Type Description
Table 35:
Value Identifier Description
Table 36:
Field Data Type Description
Table 37:
Value Identifier Description
Table 38:
Value Identifier Description SQL Data Type2
86 TEXT SHORTTEXT
68 DATE
116 TIME
84 TEXT_OLD
2 This reflects the default mapping of SQL data types to column store types.
69 UNITDECFLOAT
77 DECIMAL_FLOAT
76 SDFLOAT
3.7.24 OUTPUTPARAMETERS
The format of the OUTPUTPARAMETERS part is the same as the format of the RESULTSET part.
The part contains the scalar output parameter values returned by the statement.3 The argument count is
always 1.
3.7.25 CONNECTOPTIONS
Table 39:
Value Identifier Data Type Description
EXECUTION
BULKOPERATIONS
2 This reflects the default mapping of SQL data types to column store types.
3 An empty output parameter part can be sent if there are no scalar output parameters in the procedure definition, but non-
scalar output parameters (tables) instead.
FORMATVERSION
VERSION
FLAGSONLY
OPTIMIZEDFORMAT
CONNECTIONID
This field contains the connection ID. It is filled by the server when the connection is established. This number
can be used in DISCONNECT/KILL commands for command or session cancellation.
COMPLETEARRAYEXECUTION
This field is set if array commands continue to process remaining input when detecting an error in an input
row. Always set for current client and server.
CLIENTLOCALE
The session locale can be set by the client. The locale is used in language-dependent handling within the SAP
HANA database calculation engine.
LARGENUMBEROFPARAMETERSSUPPORT
This field contains the host name of the server, without any domain part. It is filled by the server with the host
name it resolves, so that it does not contain an alias name of the database server.
SYSTEMID
This option is set by the server and filled with the SAPSYSTEMNAME of the connected instance for tracing and
supportability purposes.
DATAFORMATVERSION2
The client indicates this set of understood type codes and field formats. The server then defines the value
according to its own capabilities, and sends it back. The following values are supported:
Table 40:
Value Description
3 Extended data type support: ALPHANUM, TEXT, SHORTTEXT, LONGDATE, SECONDDATE, DAYDATE,
SECONDTIME supported without translation. Deprecated, do not use
4 Support for ALPHANUM, TEXT, SHORTTEXT, LONGDATE, SECONDDATE, DAYDATE, and SECONDTIME.
Baseline data type support format for SAP HANA SPS 06.
ABAPVARCHARMODE
This field is set by the client to indicate that the connection should honor the ABAP character handling, that is:
This field is set by the client to indicate that the client is able to handle the special function code for SELECT …
FOR UPDATE commands.
CLIENTDISTRIBUTIONMODE
This field is set by the client to indicate the mode for handling statement routing and client distribution. The
server sets this field to the appropriate support level depending on the client value and its own configuration.
The following values are supported:
Table 41:
Value Description
1 CONNECTION, client can connect to any (master/slave) server in the topology, and connections are ena
bled, such that the connection load on the nodes is balanced.
2 STATEMENT, server returns information about which node is preferred for executing the statement, cli
ents execute on that node, if possible.
ENGINEDATAFORMATVERSION
The server sets this field to the maximum version it is able to support. The possible values correspond to the
DATAFORMATVERSION flag.
DISTRIBUTIONPROTOCOLVERSION
This field is set by the client and indicates the support level in the protocol for distribution features. The server
may choose to disable distribution if the support level is not sufficient for the handling.
Table 42:
Value Description
0 Baseline version
1 Client handles statement sequence number information (statement context part handling).
CLIENTDISTRIBUTIONMODE is OFF if a value less than one (<1) is returned by the server.
This field is sent by the client and returned by the server if configuration allows splitting batch (array)
commands for parallel execution.
USETRANSACTIONFLAGSONLY
This field is sent by the server to indicate the client should gather the state of the current transaction only from
the TRANSACTIONFLAGS command, not from the nature of the command (DDL, UPDATE, and so on).
IGNOREUNKNOWNPARTS
This field is sent by the server to indicate it ignores unknown parts of the communication protocol instead of
raising a fatal error.
TABLEOUTPUTPARAMETER
This field is sent by the client to indicate that it understands output parameters described by type code TABLE
in result sets.
ITABPARAMETER
This field is sent by the server to signal it understands ABAP ITAB parameters of SQL statements (For-All-
Entries Optimization).
DESCRIBETABLEOUTPUTPARAMETER
This field is sent by the client to request that table output parameter metadata is included in the parameter
metadata of a CALL statement.4 The returned type of the table output parameter is either STRING or TABLE,
depending on the TABLEOUTPUTPARAMETER connect option.
The following table further illustrates the use of the connect options. An option can depend on:
4 This is the same behavior that can be achieved by setting the parameter
omit_table_output_parameter_metadata to false, except that by using the connect option, the setting is only
valid for the current session, not globally for the database instance.
Of course, more than one of these statements can be true for any option.
Table 43:
Option Client Pa Server Pa Version De
rameter rameter pendent
CONNECTIONID - - -
COMPLETEARRAYEXECUTION - - X
CLIENTLOCALE X - -
SUPPORTSLARGEBULKOPERATIONS - - X
LARGENUMBEROFPARAMETERSSUPPORT - X X
SYSTEMID - - -
DATAFORMATVERSION X - X
ABAPVARCHARMODE X - X
SELECTFORUPDATESUPPORTED - - X
CLIENTDISTRIBUTIONMODE X X X
ENGINEDATAFORMATVERSION - - X
DISTRIBUTIONPROTOCOLVERSION - - X
SPLITBATCHCOMMANDS X X X
USETRANSACTIONFLAGSONLY - - X
IGNOREUNKNOWNPARTS - - X
TABLEOUTPUTPARAMETER X - X
ITABPARAMETER - X X
DESCRIBETABLEOUTPUTPARAMETER X - X
IMPLICITLOBSTREAMING
This field is sent by the client and indicates whether the server supports implicit LOB streaming even though
auto-commit is on instead of raising an error.
Table 44:
Value Identifier Data Type Description
If HOLDCURSORSOVERCOMMIT is set by the client on commit, not only cursors marked explicitly as HOLD,
but all cursors, are held.5
3.7.27 FETCHOPTIONS
Table 45:
Value Identifier Data Type Description
The RESULTSETPOS field can be used to skip over entries when fetching.6
3.7.28 FETCHSIZE
The FETCHSIZE part contains one 4-byte integer value (little-endian) defining the number of rows the
application wants to fetch.
3.7.29 PARAMETERMETADATA
This part contains metadata (type information) of parameters, that is, input parameters of prepared
statements, and additional output parameters of stored procedure call statements.
A PARAMETERMETADATA part starts with an array of entries having the following structure:
Table 46:
Field Data Type Description
NAMEOFFSET UI4 Offset of parameter name in part, set to 0xFFFFFFFF to signal no name
The PARAMETEROPTIONS field is a bit set, which has the following defined values:
Table 47:
Bit Identifier Description
The MODE field is a bit set that defines the direction of a parameter:
Table 48:
Bit Identifier Description
The array of parameter descriptions may be followed by the names of the parameters. Here, each name is
written in the following format:
Table 49:
Field Data Type Description
A RESULTSETMETADATA part starts with an array of entries having the following structure:
Table 50:
Field Data Type Description
The COLUMNOPTIONS field is a bit set which has the following defined values:
Table 51:
Bit Identifier Description
The array of column descriptions may be followed by the individual schema names, table names, column
names, and column display names. Here, each name is written in the following format:
3.7.31 FINDLOBREQUEST
The FINDLOBREQUEST part is sent from the client to search for a substring of a BLOB, CLOB, NCLOB, or
TEXT value.
Table 53:
Field Data Type Description
3.7.32 FINDLOBREPLY
The FINDLOBREPLY part is sent from the database server to the client in response to a FINDLOBREQUEST
part.
It contains one 8-byte integer value (little-endian) defining the position within the locator of the search pattern.
The value is -1 to indicate that the pattern has not been found.
3.7.33 ITABSHM
This part describes how the memory used for ITAB transfer is sent to the SAP HANA database.
Table 54:
Field Data Type Description
Table 55:
Value Identifier Description
3.7.34 CLIENTINFO
The client info part contains key/value pairs, sent by the client for additional information.
The fields are formatted as variable length strings (like an NSTRING value in result set part). The argument
count is the number of strings in the part. Because these are key/value pairs, the argument count is always an
even number.
3.7.35 STREAMDATA
The STREAMDATA part contains stream data read or written by a C++ database procedure.
Its structure depends on the field information described by the corresponding ABAPITAB parameter.
3.7.36 BATCHPREPARE
3.7.37 BATCHEXECUTE
The TRANSACTIONFLAGS part can return one or more of the following defined options:
Table 56:
Value Identifier Data Type Description
STARTED
STARTED
The part is sent from the server to signal changes of the current transaction status (committed, rolled back,
start of a write transaction) and changes of the general session state, that is, whether the transaction isolation
level has been changed, or whether DDL statements are automatically committed or not. Also, the server can
signal it has detected a state that makes it impossible to continue processing the session.
3.7.39 DBCONNECTINFO
Table 57:
Value Identifier Data Type Description
In the request message, only the database name is sent. The replied message includes the ISCONNECTED
value, and may include HOST, and PORT values. The DATABASENAME value is not sent back.
The LOBFLAGS part can return one or more of the following defined options:
Table 58:
Value Identifier Data Type Description
The part is sent from the client to signal whether the implicit LOB streaming is started so that the server does
not commit the current transaction even with auto-commit on while LOB streaming.
Input fields generally consist of type code information, followed possibly by field data, if the value is not the
NULL value.
The value is left blank if the type code indicates a NULL value (the MSB of the type code field is set). The
following sections only describe the VALUE format.
Output fields contain no special type code field. The type information is supplied in the respective
PARAMETERDATA (for output parameters) or RESULTSETMETADATA parts. All output data is densely
packed, that is, there are no gaps between individual values. Thus, some values may not be aligned in memory
as required for the native type.
3.8.1 TINYINT
Input TINYINT
Output TINYINT
Table 59:
Field Data Type Description
The field has a length of 2-bytes if the value is not NULL, and 1-byte if the value is NULL.
3.8.2 SMALLINT
Input SMALLINT
Output SMALLINT
Table 60:
Field Data Type Description
The field has a length of 3-bytes if the value is not NULL, and 1-byte if the value is NULL.
3.8.3 INT
Input INT
Table 61:
Field Data Type Description
The field has a length of 5-bytes if the value is not NULL, and 1-byte if the value is NULL.
3.8.4 BIGINT
Input BIGINT
Output BIGINT
Table 62:
Field Data Type Description
The field has a length of 9-bytes if the value is not NULL, and 1-byte if the value is NULL.
Input DECIMAL
Table 63:
Field Length Description
EXPONENT 14-bit Exponent, biased with 6176, leading to a range -6143 to +6144
The number represented is (10^EXPONENT)*MANTISSA. It is expected that MANTISSA is not a multiple of 10.
Output DECIMAL
A DECIMAL value is formatted similarly as the input format, with the NULL value indicated by having bits 4, 5,
and, 6 set to 1 in the last byte.
3.8.6 REAL
Input REAL
A REAL value is sent as float value (IEEE single precision floating point), in little-endian format.
Output REAL
A REAL value is sent as float value (IEEE single precision floating point), in little-endian format. The NULL value
is indicated by all bit sets in the value sent from the server (equal to 0xFFFFFFFF as unsigned int).
Input DOUBLE
A REAL value is sent as double value (IEEE double precision floating point), in little-endian format.
Output DOUBLE
A DOUBLE value is sent as double value (IEEE double precision floating point), in little-endian format. The
NULL value is indicated by all bit sets in the value sent from the server (equal to 0xFFFFFFFFFFFFFFFFul as
unsigned long).
3.8.8 STRING/NSTRING
Input STRING/NSTRING
● The length in bytes of VALUE, if the VALUE length is less than or equal to 245
● 246, followed by a 2-byte integer (little-endian), which contains the actual length of VALUE
● 247, followed by a 4-byte integer (little-endian), which contains the actual length of VALUE
Output STRING/NSTRING
The formatting is similar to the input value, with a LENGTHINDICATOR value of 255 indicating a NULL value.
Input BINARY
A BINARY input value is formatted similarly as the STRING/NSTRING value, with respect to a
LENGTHINDICATOR and a VALUE part. The VALUE contains the binary data.
Output BINARY
The formatting is similar to the input value, with a LENGTHINDICATOR value of 255 indicating a NULL value.
3.8.10 BLOB/CLOB/NCLOB
Input BLOB/CLOB/NCLOB
A BLOB/CLOB/NCLOB field is indicated using an input LOB descriptor, followed by the LOB data after the end
of the record.
Table 64:
Field Data Type Description
The DATA field does not immediately follow the descriptor. First, all parameters of a row are transferred, and
then the BLOB/CLOB/NCLOB data follows.
Table 65:
Bit Identifier Description
Output BLOB/CLOB/NCLOB
A BLOB/CLOB/NCLOB field is formatted using an output LOB descriptor, followed by the LOB data.
Table 66:
Field Data Type Description
The TYPE field further refines the LOB source type code received in the result set metadata.
Table 67:
Value Data Type
0 undefined
1 BLOB
2 CLOB
3 NCLOB
Table 68:
Bit Identifier Description
Table 69:
Field Data Type Description
YEAR I2 Year
MONTH I1 Month
DAY I2 Day
A NULL value is indicated by the MSB (0x8000) set in the YEAR field.
3.8.12 TIME
Table 70:
Field Data Type Description
HOUR I1 Hour
MINUTE I1 Minute
A NULL value is indicated by setting the MSB (0x80) in the HOUR field.
3.8.13 TIMESTAMP
Input TIMESTAMP
7 This format is retained for purpose of compatibility, DAYDATE is used where possible and the endorsed format.
8 This format is retained for compatibility purposes. SECONDTIME is used where possible and is the endorsed format.
A TIMESTAMP is formatted as a DATE value followed by a TIME value. A NULL value is indicated by setting the
NULL value in both components. For more information about the DATE and TIME formats, see Related
Information.
Related Information
3.8.14 ABAPITAB
3.8.15 ABAPSTRUCT
Input ABAPSTRUCT
An ABAPSTRUCT is formatted similarly as a BINARY value. The layout of the structure depends on meta-
information known only to the processing liveCache C++ Procedure and the ABAP client.
Output ABAPSTRUCT
9 This format is retained for compatibility purposes. The LONGDATE or SECONDDATE formats are used where possible and
are the endorsed formats.
3.8.17 SECONDDATE
3.8.18 DAYDATE
A DAYDATE is computed by taking the Julian Day Number of the specified date and subtracting 1721423.
3.8.19 SECONDTIME
Input ST_POINT/ST_POINTZ/ST_GEOMETRY
The following section depicts common scenarios and the parameters that apply.
As laid out in the sequence diagram below, the authentication and connection process consist of possibly a
number of AUTHENTICATE messages, finally concluded with the exchanging of a CONNECT message.
For several fields in the authentication request a LENGTHINDICATOR is used. It can be up to 5-bytes:
● The length in bytes of the following value, if the length is less 250
● 250, followed by a 2-byte integer (little-endian) which contains the actual length of the value
The following sections explain, in detail, the processing of the various authentication methods.
Following the SCRAMSHA256 authentication mechanism two server roundtrips are necessary, an initial
request and a final request.
Table 71:
Field Data Type Description
Table 72:
Field Data Type Description
Table 73:
Field Data Type Description
Table 74:
Field Data Type Description
Table 75:
Field Data Type Description
Table 76:
Field Data Type Description
Table 77:
Field Data Type Description
Table 78:
Field Data Type Description
Table 79:
Field Data Type Description
Table 81:
Field Data Type Description
Table 82:
Field Data Type Description
Table 83:
Field Data Type Description
Session cookies can only be used in case of a reconnection. The cookie is obtained from a previous
connection. It makes two server roundtrips.
Table 84:
Field Data Type Description
Table 85:
Field Data Type Description
Table 86:
Field Data Type Description
Table 87:
Field Data Type Description
Statement routing is the method of evaluating the correct server node of a distributed system before
statement execution. It reduces the overhead in server processing and reduces communication between
server nodes.
For SQLDBC-based clients, such as ODBC, ODBO, ADO.NET, Python DB API, and DBSL, the client library
makes statement routing decisions to reduce server-side inter-node routing. To utilize this feature, the
optimized_routing_for_partition_table property must be set to "on". This is done by default.
Table 88: Utilization of Table Partitioning Information for Statement Routing Optimization
Hash partitioning during split batch in Split batch not supported Yes
sert
Range partitioning during split batch in Split batch not supported Yes
sert
Note
Active/Active (Read Enabled) hint-based routing uses the same mechanism as statement routing.
Preconditions
The server decides which statements are eligible for statement routing. When preparing a statement, the
server returns a TABLELOCATION part or a PARTITIONINFORMATION part to describe the preferred nodes in
detail.
FAE For All Entries. A specific ABAP Language construct, where a client-side table is joined with a server-
side table.
FDA Fast Data Access. A method to submit data for INSERT in the format used by the SAP ABAP
Application Server (ABAP Table) to the server or retrieve SELECT results in the same format, to avoid
field-wise copying and data conversion.
MSB Most Significant Bit. The highest bit in an integer value, for example, Bit 7 in a byte.
SAP HANA server software and tools can be used for several SAP HANA platform and options scenarios as
well as the respective capabilities used in these scenarios. The availability of these is based on the available
SAP HANA licenses and the SAP HANA landscape, including the type and version of the back-end systems the
SAP HANA administration and development tools are connected to. There are several types of licenses
available for SAP HANA. Depending on your SAP HANA installation license type, some of the features and
tools described in the SAP HANA platform documentation may only be available in the SAP HANA options and
capabilities, which may be released independently of an SAP HANA Platform Support Package Stack (SPS).
Although various features included in SAP HANA options and capabilities are cited in the SAP HANA platform
documentation, each SAP HANA edition governs the options and capabilities available. Based on this,
customers do not necessarily have the right to use features included in SAP HANA options and capabilities.
For customers to whom these license restrictions apply, the use of features included in SAP HANA options and
capabilities in a production system requires purchasing the corresponding software license(s) from SAP. The
documentation for the SAP HANA options is available in SAP Help Portal. If you have additional questions
about what your particular license provides, or wish to discuss licensing features available in SAP HANA
options, please contact your SAP account team representative.
Coding Samples
Any software coding and/or code lines / strings ("Code") included in this documentation are only examples and are not intended to be used in a productive system
environment. The Code is only intended to better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and
completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, unless damages were caused by SAP
intentionally or by SAP's gross negligence.
Accessibility
The information contained in the SAP documentation represents SAP's current view of accessibility criteria as of the date of publication; it is in no way intended to be
a binding guideline on how to ensure accessibility of software products. SAP in particular disclaims any liability in relation to this document. This disclaimer, however,
does not apply in cases of willful misconduct or gross negligence of SAP. Furthermore, this document does not result in any direct or indirect contractual obligations
of SAP.
Gender-Neutral Language
As far as possible, SAP documentation is gender neutral. Depending on the context, the reader is addressed directly with "you", or a gender-neutral noun (such as
"sales person" or "working days") is used. If when referring to members of both sexes, however, the third-person singular cannot be avoided or a gender-neutral noun
does not exist, SAP reserves the right to use the masculine form of the noun and pronoun. This is to ensure that the documentation remains comprehensible.
Internet Hyperlinks
The SAP documentation may contain hyperlinks to the Internet. These hyperlinks are intended to serve as a hint about where to find related information. SAP does
not warrant the availability and correctness of this related information or the ability of this information to serve a particular purpose. SAP shall not be liable for any
damages caused by the use of related information unless damages have been caused by SAP's gross negligence or willful misconduct. All links are categorized for
transparency (see: http://help.sap.com/disclaimer).