Entering content frame

Procedure documentation Executing Loader Commands and SQL Statements with Java Locate the document in the library structure

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.

Prerequisites

·        Connecting to the Loader with Java

·        For the prerequisites that you must meet before you can execute Loader commands or SQL statements, see the appropriate descriptions of the commands and SQL statements in the Loader documentation.

Procedure

You use 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

 

Leaving content frame