Entering content frame

 Perl: Loader Class 

Constructor: Loader (<server_node>, <database_name>)

<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 on the local system.

The session is closed again when the object is deleted with undef $session.

$session = loader::Loader ('p12345', 'mydb')

Method: cmd (<command_string>)

An SQL statement or Loader command is executed.

The script is terminated if the command fails.

$output = $session->cmd ("DATALOAD TABLE kunde".
                        "cno       1-4".
                           "name      6-12  ".
                           "zip       14-18 ".
                           "city      20-31 ".
                        "INFILE '$data_path\customer.dat' ")

Method: sql (<command_string>)

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')

 

Leaving content frame