Entering content frame

Background documentation Method sql Locate the document in its SAP Library structure

Definition

sql (cmd)

Use

sql is a method of the class SapDB_Session. When this method is called, the SQL statement cmd is executed.

Result

The type of the result depends on the content of the SQL statement (see Possible SQL Results).

Example

Executing a data query (for example, SELECT statement)

cursor = session.sql ('SELECT * FROM messages')

The variable cursor contains an object of the class SapDB_ResultSet. You can use this object to access the data records in the results set.

 

Executing a data manipulation action (for example, a DELETE statement)

rowsDeleted = session.sql ('DELETE FROM testtable WHERE column = 3')

The variable rowsDeleted contains the number of lines deleted by the DELETE statement.

 

Leaving content frame