SQL Update – Source Reference
The SQL Update <SQLUpdate> element is used for updating data in Db2. It can contain a number of SQL statements for inserting, updating and deleting rows. It can even be used to create and drop tables.
Syntax
The syntax of the SQL Update element is
<Statement><![CDATA[All the statements separated by ;]]>
</Statement>
</SQLUpdate>
The name attribute is only used to present in the user interface and in the execution log file. All SQL statements are written in the Statement element that is using a CDATA to preserve statements for an greater visual experience when looking at the source.
Example
The following example shows how to a row is deleted, then a new row is inserted and finally the same row is updated. The example uses variable substitution and the variable rident must be present earlier in the test scenario. This variable contains the ID of the employee to delete, insert and update.
<Statement><![CDATA[delete from XATEST.XAEMPLOYEE where
RIDENT=${rident};
insert into XATEST.XAEMPLOYEE (RIDENT,FIRSTNAME,LASTNAME)
values (${rident},'Steen','Brahe');
update XATEST.XAEMPLOYEE set FIRSTNAME='Steen1' where RIDENT=${rident};]]>
</Statement>
</SQLUpdate>