Differences

This shows you the differences between two versions of the page.

Link to this comparison view

execsql_tag [2016/09/22 02:35] (current)
Line 1: Line 1:
 +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 [[datasetTag|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.
Print/export
QR Code
QR Code execsql_tag (generated for current page)