Entering content frame

 Executing Loader Commands and SQL Statements with Java 

Use

You can use the Java method cmd to execute Loader commands and SQL statements supported by the Loader. The parameter cmdString must contain a valid Loader command or a valid SQL statement.

The return code of the method contains the return code of the Loader command or SQL statement.

See also:

Connecting to the Loader with Java

Prerequisites

You can execute the commands and SQL statements for loading and unloading data only after setting up a database session successfully. For the prerequisites that you must meet before you can execute Loader commands or SQL statements, see the appropriate descriptions of the commands and statements in the Loader documentation.

Definition of the Method cmd

    public String cmd (String cmdString)

        throws

            com.sap.dbtech.rte.comm .RTEException,

            com.sap.dbtech.powertoys.LoaderException;

Example

Using the method cmd to execute the CREATE TABLE statement for creating the table LOADERTEST:

String result = session.cmd ("CREATE TABLE LOADERTEST ("+ "TESTCOL VARCHAR(20) )");

System.out.println (result);

 

See also:

Example for Creating a Table with Java (a complete procedure)

 

Leaving content frame