Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC

Class TStatement

Used to execute SQL commands.

Method Summary
close
         Releases all the database resources held by this object.
execute sqlStatement
         Executes an arbitrary SQL statement.
query sqlStatement
         Executes a SQL query.
update sqlStatement
         Executes a SQL statement that modifies the contents of the database.

Method Detail

close

TStatement close

Releases all the database resources held by this object.

Releases all the database resources used by this object. The object can then no longer be used. All the TResultSet created by this object that are still opened are also closed automatically.

execute

TStatement execute sqlStatement

Executes an arbitrary SQL statement.

Parameters:
sqlStatement - A string representing a SQL statement.

Executes a SQL statement on the database this TStatement is associated with. This method is tipically used to execute DDL statements, but it can also execute any type os SQL statement. If there is something wrong with the sqlStatement string (e.g. a syntax error) a runtime error will ocurr.

query

TStatement query sqlStatement

Executes a SQL query.

Parameters:
sqlStatement - A string representing a SQL statement with a SELECT command.
Returns:
An instance of TResultSet that represents the result of the execution of the sqlStatement query.

Executes a SQL query on the database this TStatement is associated with. It returns a TResultSet object containing the records resulting from the query. If there is something wrong with the sqlStatement string (e.g. a syntax error) then an runtime error ocurrs.

The instance of TResultSet returned by the method can be used to iterate through the records that resulted from the query.


update

TStatement update sqlStatement

Executes a SQL statement that modifies the contents of the database.

Parameters:
sqlStatement - A string representing a SQL statement with an UPDATE, INSERT or DELETE command.
Returns:
An integer object representing the number of records modified in the database.

Executes a SQL statement on the database this TStatement is associated with. The statement is supposed to modify, insert or remove records in the database. If there is something wrong with the sqlStatement string (e.g. a syntax error) or if the changes would violate an integrity constraint then an runtime error will ocurr.


Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC
Report a bug or request new features
© 2002