Entering content frame

 Method prepare 

Definition

prepare (cmd)

Use

prepare is a method of the class SapDB_Session. When you call this method, you send the SQL statement cmd to the database to be checked.

Result

The result is an object of the class SapDB_Prepared.

You can use this object to execute the same SQL statement more than once and with different parameters, without making the database check the syntax and privileges every time. To do this, you use the method execute.

Generating an INSERT statement for inserting data in the table TESTTABLE

insert = session.prepare ('INSERT INTO testtable VALUES (?,?)')

The variable insert contains an object of the class SapDB_Prepared. You can use this object to execute the INSERT statement with different parameters.

 

Leaving content frame