<server_node> |
Server node name |
<database_name> |
Name of the database instance |
Establishing a connection to the Loader.
If the server node name and name of the database instance are specified, the system assumes that the database instance, data, and Loader are located on a remote server.
If only the name of the database instance is specified, the system assumes that the database instance, data, and Loader are located on the local server. The suitable Loader is determined from the version of the specified database instance.
If neither the server node name nor the name of the database instance is specified, the system establishes a connection to the newest Loader version on the local system.
The session is closed again when the object is deleted with del session.
session = loader.Loader ('p12345', 'mydb')
An SQL statement or Loader command is executed.
The script is terminated if the command fails.
output = session.cmd
("""DATALOAD TABLE
customer
cno 1-4
name 6-12
zip 14-18
city 20-31
INFILE
'%s\customer.dat' """ %data_path)
An SQL statement or a Loader command is executed.
If a command fails, execution of the script is terminated.
If an SQL statement fails, a return code is output.
result = session.sql ('EXISTS TABLE MYTABLE')