This is an old revision of the document!
Use execSQL tag (rel 3.0) to execute an SQL statement. The statement can be an update, insert, delete or a stored procedure call but it can not be a select statement. To execute a select statement, use dataset tag.
The following are a few examples of how to use this tag:
- update statement:
<execSQL db="myDB">
<sql>
UPDATE myTable
SET test_case_status = "passed"
WHERE test_case_nbr = 201
</sql>
</execSQL>
- insert statement:
<execSQL db="myDB">
<sql>
INSERT INTO myTable (test_case_nbr, test_case_status)
VALUES (201, "passed")
</sql>
</execSQL>
- stored procedure call statement:
<execSQL db="myDB">
<sql>
{call addTestCaseResult (201, "passed") }
</sql>
</execSQL>
If your db requires use of single quote to enclose the string, use [quot] instead. [quot] will be replaced with a single quote before the statement is sent to the database.