SAP HANA SQL Command Network Protocol (HDB)¶
The following subsections show a graphical representation of the main protocol packets and how to generate them.
First we need to perform some setup to import the packet classes:
[1]:
from pysap.SAPHDB import *
from pprint import pprint
from IPython.display import display
SAP HANA SQL Command Network Protocol Initialization Request Packet¶
[2]:
p = SAPHDBInitializationRequest()
p.canvas_dump()
[2]:

SAP HANA SQL Command Network Protocol Initialization Reply Packet¶
[3]:
p = SAPHDBInitializationReply()
p.canvas_dump()
[3]:

SAP HANA SQL Command Network Protocol Segment packet¶
[5]:
for segment_kind in hdb_segmentkind_values:
p = SAPHDBSegment(segmentkind=segment_kind)
print(hdb_segmentkind_values[segment_kind])
display(p.canvas_dump())
Invalid

Request

Reply

Error

SAP HANA SQL Command Network Protocol Part packet¶
[6]:
for part_kind in hdb_partkind_values:
p = SAPHDBPart(partkind=part_kind)
print(hdb_partkind_values[part_kind])
display(p.canvas_dump())
NIL

COMMAND

RESULTSET

ERROR

STATEMENTID

TRANSACTIONID

ROWSAFFECTED

RESULTSETID

TOPOLOGYINFORMATION

TABLELOCATION

READLOBREQUEST

READLOBREPLY

ABAPISTREAM

ABAPOSTREAM

COMMANDINFO

WRITELOBREQUEST

CLIENTCONTEXT

WRITELOBREPLY

PARAMETERS

AUTHENTICATION

SESSIONCONTEXT

CLIENTID

PROFILE

STATEMENTCONTEXT

PARTITIONINFORMATION

OUTPUTPARAMETERS

CONNECTOPTIONS

COMMITOPTIONS

FETCHOPTIONS

FETCHSIZE

PARAMETERMETADATA

RESULTSETMETADATA

FINDLOBREQUEST

FINDLOBREPLY

ITABSHM

ITABCHUNKMETADATA

ITABMETADATA

ITABRESULTCHUNK

CLIENTINFO

STREAMDATA

OSTREAMRESULT

FDAREQUESTMETADATA

FDAREPLYMETADATA

BATCHPREPARE

BATCHEXECUTE

TRANSACTIONFLAGS

ROWSLOTIMAGEPARAMMETADATA

ROWSLOTIMAGERESULTSET

DBCONNECTINFO

LOBFLAGS

RESULTSETOPTIONS

XATRANSACTIONINFO

SESSIONVARIABLE

WORKLOADREPLAYCONTEXT

SQLREPLYOTIONS

SAP HANA SQL Command Network Protocol Authenticate Segment¶
SAP HANA SQL Command Network Protocol Authentication Field¶
[7]:
auth_fields = [SAPHDBPartAuthenticationField(value="username"),
SAPHDBPartAuthenticationField(value="SCRAMSHA256"),
SAPHDBPartAuthenticationField(value="XXXXX")]
for auth_field in auth_fields:
display(auth_field.canvas_dump())



SAP HANA SQL Command Network Protocol Authentication Part¶
[8]:
auth_part = SAPHDBPartAuthentication(auth_fields=auth_fields)
display(auth_part.canvas_dump())

SAP HANA SQL Command Network Protocol Client ID Part¶
[9]:
p = SAPHDBPartClientId(clientid="pid@hostname")
display(p.canvas_dump())

SAP HANA SQL Command Network Protocol Command Part¶
[10]:
p = SAPHDBPartCommand(command="command")
display(p.canvas_dump())

SAP HANA SQL Command Network Protocol Error Part¶
[11]:
p = SAPHDBPartError()
display(p.canvas_dump())

SAP HANA SQL Command Network Protocol Option Part Row¶
[12]:
p = SAPHDBOptionPartRow()
display(p.canvas_dump())

[13]:
for option_part_class in SAPHDBOptionPartRow.__subclasses__():
print(option_part_class._name)
for key, value in option_part_class.option_keys.items():
print("Key: %s\tName: %s" % (key, value))
print("")
SAP HANA SQL Command Network Protocol Command Information Part
Key: 1 Name: Line Number
Key: 2 Name: Source Module
SAP HANA SQL Command Network Protocol Client Context Part
Key: 1 Name: Client Version
Key: 2 Name: Client Type
Key: 3 Name: Application Name
SAP HANA SQL Command Network Protocol Session Context Part
Key: 1 Name: Primary Connection ID
Key: 2 Name: Primary Host Name
Key: 3 Name: Primary Host Port Number
Key: 4 Name: Master Connection ID
Key: 5 Name: Master Host Name
Key: 6 Name: Master Host Port Number
SAP HANA SQL Command Network Protocol Statement Context Part
Key: 1 Name: Statement Sequence Info
Key: 2 Name: Server Processing Time
Key: 3 Name: Schema Name
Key: 4 Name: Flag Set
Key: 5 Name: Query Time Out
Key: 6 Name: Client Reconnection Wait Timeout
Key: 7 Name: Server CPU Time
Key: 8 Name: Server Memory Usage
SAP HANA SQL Command Network Protocol Connect Options Part
Key: 1 Name: Connection ID
Key: 2 Name: Complete Array Execution
Key: 3 Name: Client Locale
Key: 4 Name: Supports Large Bulk Operations
Key: 5 Name: Distribution Enabled
Key: 6 Name: Primary Connection ID
Key: 7 Name: Primary Connection Host
Key: 8 Name: Primary Connection Port
Key: 9 Name: Complete Data Type Support
Key: 10 Name: Large Number of Parameters Support
Key: 11 Name: System ID
Key: 12 Name: Data Format Version
Key: 13 Name: ABAP VARCHAR Mode
Key: 14 Name: Select for Update Supported
Key: 15 Name: Client Distribution Mode
Key: 16 Name: Engine Data Format Version
Key: 17 Name: Distribution Protocol Version
Key: 18 Name: Split Batch Commands
Key: 19 Name: Use Transaction Flags Only
Key: 20 Name: Row and Column Optimized Format
Key: 21 Name: Ignore Unknown Parts
Key: 22 Name: Table Output Parameter
Key: 23 Name: Data Format Version 2
Key: 24 Name: ITAB Parameter
Key: 25 Name: Describe Table Output Parameter
Key: 26 Name: Columnar Result Set
Key: 27 Name: Scrollable Result Set
Key: 28 Name: Client Info NULL Value Supported
Key: 29 Name: Associated Connection ID
Key: 30 Name: Non-Transactional Prepare
Key: 31 Name: Fast Data Access Enabled
Key: 32 Name: OS User
Key: 33 Name: Row Slot Image Result
Key: 34 Name: Endianness
Key: 35 Name: Update Topology Anwhere
Key: 36 Name: Enable Array Type
Key: 37 Name: Implicit LOB Streaming
Key: 38 Name: Cached View Property
Key: 39 Name: X OpenXA Protocol Supported
Key: 40 Name: Master Commit Redirection Supported
Key: 41 Name: Active/Active Protocol Version
Key: 42 Name: Active/Active Connection Origin Site
Key: 43 Name: Query Timeout Supported
Key: 44 Name: Full Version String
Key: 45 Name: Database Name
Key: 46 Name: Build Platform
Key: 47 Name: Implicit XA Session Supported
Key: 48 Name: Client Side Column Encryption Version
Key: 49 Name: Compression Level And Flags
Key: 50 Name: Client Side Re-Execution Supported
Key: 51 Name: Client Reconnect Wait Timeout
Key: 52 Name: Original Anchor Connection ID
Key: 53 Name: Flag Set 1
Key: 54 Name: Topology Network Group
Key: 55 Name: IP Address
Key: 56 Name: LRR Ping Time
SAP HANA SQL Command Network Protocol Commit Options Part
Key: 1 Name: Hold Cursors Over Commit
SAP HANA SQL Command Network Protocol Fetch Options Part
Key: 1 Name: Result Set Pos
SAP HANA SQL Command Network Protocol Transaction Flags Part
Key: 0 Name: Rolled Back
Key: 1 Name: Commited
Key: 2 Name: New Isolation Level
Key: 3 Name: DDL Commit Mode Changed
Key: 4 Name: Write Transaction Started
Key: 5 Name: No Write Transaction Started
Key: 6 Name: Session Closing Transaction Error
SAP HANA SQL Command Network Protocol DB Connect Information Part
Key: 1 Name: Database Name
Key: 2 Name: Host
Key: 3 Name: Port
Key: 4 Name: Is Connected
SAP HANA SQL Command Network Protocol LOB Flags Part
Key: 0 Name: Implicit Streaming
SAP HANA SQL Command Network Protocol Multi-Line Option Part¶
[14]:
p = SAPHDBMultiLineOptionPartRow()
display(p.canvas_dump())
