Performs calculations upon a data set and writes the results back to
the database, by using a SELECT
input query and a stored procedure
or an UPDATE/INSERT
command.
inputQuery
. If the underlying component contains
several methods named meethodName
, the one that fits best the number
columns returned is chosen.SELECT
SQL query that returns enough columns
to invoke methodName
. Every column will be passed on to the method in
the order they were queried.storedProcedure
flag is set, the outputQuery is run as a stored
procedure, otherwise this method will treat it as an SQL statement.methodName
to. If only one result is expected, pass in
a String
- the name of the named parameter. If more than one value
is supposed to be returned by methodName
, pass in a String
array representing the names of the IN parameters of the output query. If your driver
does not support named parameters, the values of the array returned by
methodName
will be added in the order of their appearance inside the
output query.true
, the output query is run
as a stored procedure, if false
the output query will be invoked
as an ordinary SQL statement.
Additionally, you should specify the named parameters where to place
the results returned by methodName
, either as a String
, or an array
of String
objects.
Exception Type | Condition |
---|---|
ADOMediatorException | Thrown to indicate run-time errors. |
The following piece of code invokes method MyMethod
by using
the SHARES
and VALUE
columns as parameters. The
"@MONEY"
named parameter is used to store the result returned by
MyMethod
.
ado.SelectAndUpdate ("MyMethod", "SELECT C_ID, SHARES, VALUE FROM TRADES", "UPDATE CUSTOMER SET MONEY=@MONEY WHERE C_ID='00001'", "@MONEY", false);
ADOMediator Class | WebCab.Libraries.Finance.Portfolio.ADO Namespace | ADOMediator.SelectAndUpdate Overload List