Activity - sqlStoredProcedure
Activity Type: Relational
Description
Run a stored procedure of a relational data resource.
Examples
<sqlStoredProcedure name="statement">
<!-- value of first parameter -->
<sqlParameter position="1" from="data"/>
<!-- value of second parameter -->
<sqlParameter position="2">321</sqlParameter>
<storedProcedureName>STORED-PROCEDURE-NAME</storedProcedureName>
<webRowSetStream name="results"/>
</sqlStoredProcedure>
<sqlStoredProcedure name="statement">
<!-- value of first parameter -->
<sqlParameter position="1" from="data"/>
<!-- value of second parameter -->
<sqlParameter position="2">321</sqlParameter>
<storedProcedureName>STORED-PROCEDURE-NAME</storedProcedureName>
<resultStream name="results"/>
</sqlStoredProcedure>
Specification
Element sqlStoredProcedure:
-
Attribute name - unique name for the
activity.
-
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.
-
storedProcedureName (required) - the name
of a stored procedure.
-
The procedure name is contained within the element.
-
OR
-
Attribute from - input stream providing the
procedure name.
-
If the procedure expects arguments then these will be taken from any
declared sqlParameter elements in the order
in that they appear. The first parameter corresponds to the first
argument, the second to the second etc.
-
One of two output stream elements (required):
-
webRowSetStream - output stream for stored
procedures which are query a database and return the query results.
-
Attribute name - name of the activity's output
stream.
-
resultStream - output stream for stored
procedures which update the database and return an update count.
-
Attribute name - name of the activity's output
stream.
Limitations
The default implementation of this activity does not work with Oracle databases.
XML Schema
OGSA-DAI/schema/ogsadai/xsd/activities/sql_stored_procedure.xsd
Implementation
OGSA-DAI/src/java/activities/uk/org/ogsadai/activity/sql/SQLStoredProcedureActivity.java