Skip Top Menu Navigation
Skip Top Menu Navigation

The FREE Enterprise Open Source Database

  Software Documentation Tools Interfaces Administration Development
 

 
You Are Here:  SAP DB > Interfaces > sapdb.dbm (Python)

SAP DB is now SAP MaxDB! For more information, visit the SAP MaxDB pages in the SAP Developer Network.

Module sapdb.dbm (Python)

Module Contents
  • class DBM
    • DBM: Opens a connection.
    • cmd: Executes a command and returns the resulting buffer as a string.
    • rawCmd: Executes a command without checking for errors and returns resulting buffer as a string.
    • release: Closes the connection.
  • saveUser: Stores a user in the client environment for authorization towards the DBM Server.
  • checkUser: Compares a user in the client environment with the current value.
  • deleteUser: Deletes a user in the client environment.
Installation

Examples Exceptions


Module Contents

class DBM

constructor DBM
session = sapdb.dbm.DBM (server_node, database_name [, dependent_path [, user_info]])

Opens a connection
  • An empty server node will search for a DBM Server on the local machine.
  • When calling general information specify neither the parameter dependent_path nor the database_name.
    When working with a specific database indicate the database_name. Do not specify the dependent_path.
    When creating a new database specify the absolute path of the relevant installation in dependent_path. Do not specify the database_name.
  • The parameter user_info must contain a string of the following format: <userid>,<password>
    Example: TEST,TEST
cmd
output = session.cmd (cmd)

Executes a command and returns the resulting buffer as string. Any error will result in an exception. For the format of the paramter cmd please see the documentation of the Database Manager CLI.

rawCmd
output = session.rawCmd (cmd)

Executes a command without checking for errors and returns the resulting buffer as string. For the format of the paramter cmd please see the documentation of the Database Manager CLI.

release
session.release ()

Closes the connection.

saveUser

sapdb.dbm.saveUser (database_name, server_node, user_password)

Stores a user in the client environment for DBM Server authorization.

checkUser

result = sapdb.dbm.checkUser (database_name, server_node, user_password)

Compares a user in the client environment with the current value.

deleteUser

sapdb.dbm.deleteUser (database_name, server_node)

Deletes a user in the client environment.



Installation

Add <dependent_path>/misc to the PYTHONPATH.

Examples

How to test whether the connection to the DBM Server can be established: testdbm.py

How to start a database: dbup.py

Exceptions

Communication Error:

The communication link to the server failed. The exception value is an instance with the following attributes:
  • errorCode
  • message


DBMServError:

The execution of the command on the server resulted in an error. The exception value is an instance with the following attributes:
  • errorCode
  • message
  • errorSymbol
  • additionalInfo


Search / Contact Info
See also ...

Questions or comments about the Web site? Contact the webmaster.