Entering content frame

 Python: Example 2 

Example of calling the Loader with Python Script

Start a database session with the Loader,
Log on to the database instance,
Log off

 

# Reference to the Python Libraries
# ---------------------------------

import sys
import loader

# Parse the call arguments
# --------------------------

user_name = sys.argv [1]
password = sys.argv [2]
database_name = sys.argv [3]
data_path = sys.argv[4]
server_node = ''

# Create a database session for the Loader  
# ----------------------------------------

session = loader.Loader (server_node, database_name)

# Log on to the database instance
# --------------------------------

session.cmd ('use user %s %s;' % (user_name, password))

# Log off
# --------

del session

 

Leaving content frame