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]:
../_images/protocols_SAPHDB_4_0.svg

SAP HANA SQL Command Network Protocol Initialization Reply Packet

[3]:
p = SAPHDBInitializationReply()
p.canvas_dump()
[3]:
../_images/protocols_SAPHDB_6_0.svg

SAP HANA SQL Command Network Protocol packet

[4]:
p = SAPHDB()
p.canvas_dump()
[4]:
../_images/protocols_SAPHDB_8_0.svg

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
../_images/protocols_SAPHDB_10_1.svg
Request
../_images/protocols_SAPHDB_10_3.svg
Reply
../_images/protocols_SAPHDB_10_5.svg
Error
../_images/protocols_SAPHDB_10_7.svg

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
../_images/protocols_SAPHDB_12_1.svg
COMMAND
../_images/protocols_SAPHDB_12_3.svg
RESULTSET
../_images/protocols_SAPHDB_12_5.svg
ERROR
../_images/protocols_SAPHDB_12_7.svg
STATEMENTID
../_images/protocols_SAPHDB_12_9.svg
TRANSACTIONID
../_images/protocols_SAPHDB_12_11.svg
ROWSAFFECTED
../_images/protocols_SAPHDB_12_13.svg
RESULTSETID
../_images/protocols_SAPHDB_12_15.svg
TOPOLOGYINFORMATION
../_images/protocols_SAPHDB_12_17.svg
TABLELOCATION
../_images/protocols_SAPHDB_12_19.svg
READLOBREQUEST
../_images/protocols_SAPHDB_12_21.svg
READLOBREPLY
../_images/protocols_SAPHDB_12_23.svg
ABAPISTREAM
../_images/protocols_SAPHDB_12_25.svg
ABAPOSTREAM
../_images/protocols_SAPHDB_12_27.svg
COMMANDINFO
../_images/protocols_SAPHDB_12_29.svg
WRITELOBREQUEST
../_images/protocols_SAPHDB_12_31.svg
CLIENTCONTEXT
../_images/protocols_SAPHDB_12_33.svg
WRITELOBREPLY
../_images/protocols_SAPHDB_12_35.svg
PARAMETERS
../_images/protocols_SAPHDB_12_37.svg
AUTHENTICATION
../_images/protocols_SAPHDB_12_39.svg
SESSIONCONTEXT
../_images/protocols_SAPHDB_12_41.svg
CLIENTID
../_images/protocols_SAPHDB_12_43.svg
PROFILE
../_images/protocols_SAPHDB_12_45.svg
STATEMENTCONTEXT
../_images/protocols_SAPHDB_12_47.svg
PARTITIONINFORMATION
../_images/protocols_SAPHDB_12_49.svg
OUTPUTPARAMETERS
../_images/protocols_SAPHDB_12_51.svg
CONNECTOPTIONS
../_images/protocols_SAPHDB_12_53.svg
COMMITOPTIONS
../_images/protocols_SAPHDB_12_55.svg
FETCHOPTIONS
../_images/protocols_SAPHDB_12_57.svg
FETCHSIZE
../_images/protocols_SAPHDB_12_59.svg
PARAMETERMETADATA
../_images/protocols_SAPHDB_12_61.svg
RESULTSETMETADATA
../_images/protocols_SAPHDB_12_63.svg
FINDLOBREQUEST
../_images/protocols_SAPHDB_12_65.svg
FINDLOBREPLY
../_images/protocols_SAPHDB_12_67.svg
ITABSHM
../_images/protocols_SAPHDB_12_69.svg
ITABCHUNKMETADATA
../_images/protocols_SAPHDB_12_71.svg
ITABMETADATA
../_images/protocols_SAPHDB_12_73.svg
ITABRESULTCHUNK
../_images/protocols_SAPHDB_12_75.svg
CLIENTINFO
../_images/protocols_SAPHDB_12_77.svg
STREAMDATA
../_images/protocols_SAPHDB_12_79.svg
OSTREAMRESULT
../_images/protocols_SAPHDB_12_81.svg
FDAREQUESTMETADATA
../_images/protocols_SAPHDB_12_83.svg
FDAREPLYMETADATA
../_images/protocols_SAPHDB_12_85.svg
BATCHPREPARE
../_images/protocols_SAPHDB_12_87.svg
BATCHEXECUTE
../_images/protocols_SAPHDB_12_89.svg
TRANSACTIONFLAGS
../_images/protocols_SAPHDB_12_91.svg
ROWSLOTIMAGEPARAMMETADATA
../_images/protocols_SAPHDB_12_93.svg
ROWSLOTIMAGERESULTSET
../_images/protocols_SAPHDB_12_95.svg
DBCONNECTINFO
../_images/protocols_SAPHDB_12_97.svg
LOBFLAGS
../_images/protocols_SAPHDB_12_99.svg
RESULTSETOPTIONS
../_images/protocols_SAPHDB_12_101.svg
XATRANSACTIONINFO
../_images/protocols_SAPHDB_12_103.svg
SESSIONVARIABLE
../_images/protocols_SAPHDB_12_105.svg
WORKLOADREPLAYCONTEXT
../_images/protocols_SAPHDB_12_107.svg
SQLREPLYOTIONS
../_images/protocols_SAPHDB_12_109.svg

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())
../_images/protocols_SAPHDB_15_0.svg
../_images/protocols_SAPHDB_15_1.svg
../_images/protocols_SAPHDB_15_2.svg

SAP HANA SQL Command Network Protocol Authentication Part

[8]:
auth_part = SAPHDBPartAuthentication(auth_fields=auth_fields)
display(auth_part.canvas_dump())
../_images/protocols_SAPHDB_17_0.svg

SAP HANA SQL Command Network Protocol Client ID Part

[9]:
p = SAPHDBPartClientId(clientid="pid@hostname")
display(p.canvas_dump())
../_images/protocols_SAPHDB_19_0.svg

SAP HANA SQL Command Network Protocol Command Part

[10]:
p = SAPHDBPartCommand(command="command")
display(p.canvas_dump())
../_images/protocols_SAPHDB_21_0.svg

SAP HANA SQL Command Network Protocol Error Part

[11]:
p = SAPHDBPartError()
display(p.canvas_dump())
../_images/protocols_SAPHDB_23_0.svg

SAP HANA SQL Command Network Protocol Option Part Row

[12]:
p = SAPHDBOptionPartRow()
display(p.canvas_dump())
../_images/protocols_SAPHDB_25_0.svg
[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())
../_images/protocols_SAPHDB_28_0.svg