This example describes the following steps:
...
1. Calling the Loader
2. Starting the session with the database instance
3. Ending the session with the database instance
# To reference Python libraries:
# ----------------------------
import sys
import loader
# Parse the call arguments
# --------------------------
database_user_name = sys.argv [1]
database_user_password = sys.argv [2]
database_name = sys.argv [3]
# Calling the Loader; the most up-to-date version of the
# Loader is started; there is still no connection
# to the database instance
# ------------------------------------------------------
session = sdb.loader.Loader ()
# Startomg the session
with the database instance
# -------------------------------------
session.cmd ('use user %s %s serverdb %s' % (database_user_name, database_user_password, database_name))
# Ending the session with the database instance
# -------------------------------------
del session
The Loader converts user name and password entries to uppercase. If you want to prevent this, you need to enter both words in the use user command in double quotation marks.
session.cmd ('use user "%s" "%s" serverdb %s' % (database_user_name, database_user_password, database_name))