Activity - sqlUpdateStatement
Activity Type: Relational
Description
Run an SQL update on a relational data resource.
Example
<sqlUpdateStatement name="statement">
<!-- value of first parameter -->
<sqlParameter position="1" from="datatoinsert"/>
<!-- value of second parameter -->
<sqlParameter position="2">321</sqlParameter>
<expression>
insert into littleblackbook values ? ?
</expression>
<resultStream name="results"/>
</sqlUpdateStatement>
Specification
Element sqlUpdateStatement:
-
Attribute name - unique name for the
activity within the scope of a request.
-
Element sqlParameter (zero or more) - define
a parameter.
-
Attribute position - position within the
expression element.
-
Attribute from (optional) - name of the
output from another activity which provides the value of this
parameter.
-
If a from value is not specified then this
element must contain a value for the
parameter.
-
The sequence in which sqlParameter elements
appear is important when the same activity will be supplying a
value for more than one parameter. The sequence in which sqlParameters appear is the sequence in which they
must be delivered from the other activity, for example:
<sqlParameter position ="1" from="inputStream"/>
<sqlParameter position ="3" from="inputStream"/>
<sqlParameter position ="2" from="inputStream"/>
This means inputStream must first deliver
parameter 1 then parameter 3 then parameter 2.
-
expression (required) - SQL update statement.
-
The SQL update statement is contained within the element.
-
OR
-
Attribute from - input stream providing the
SQL update statement.
-
? can be used as a place-holder for any
parameters that have been defined in sqlParameter elements. The first parameter
corresponds to the first place-holder, the second to the second etc.
-
resultStream (required) - output
stream which produces an XML element that holds the number of modified rows.
-
Attribute name - name of the activity's output
stream.
Data Resource Accessor
This activity requires a data resource accessor that implements the following
interface:
uk.org.ogsadai.dataresource.JDBCConnectionProvider
Input and Output Types
XML Schema
OGSA-DAI/schema/ogsadai/xsd/activities/sql_update_statement.xsd
Class
uk.org.ogsadai.activity.sql.SQLUpdateStatementActivity
Client Toolkit Class
uk.org.ogsadai.client.toolkit.activity.sql.SQLUpdate