RelDBQueryProcess

Top  Previous  Next

org.moremotion.mmcomp.reldb.RelDBQueryProcess class existing in mmcomp_reldb.jar extends MoreMotion's org.moremotion.process.QueryProcess base class and it is used to query relational data bases and start a set of sub-process for each result record returned from the query.

See configuring a callQueryProcess element in a processTemplate configuration.

This class is configured as follows.

  <process name="GetAClassCustomers" basedon="mor.RelDB.RelDBQueryProcess">
    <param name="conn">SuperStore</param>
    <param name="query">SELECT ID FROM customers WHERE TYP = 'A'</param>
  </process>

Parameters

conn (Accepts MScript)

The name of a JDBC connection that is configured with jdbcConnection element.

query (Accepts MScript)

The query that defines the result records to be used by the sub-processes. In the output Process Records there will be a field for each column existing in the result set. Therefore it is recommended to select only the required columns (e.g. SELECT ID, NAME FROM ...) instead of selecting all columns (SELECT * FROM ...)

By using MScript the SQL statements can be constructed dynamically.

  SELECT DISTINCT ID FROM customers c, orders o
    WHERE o.ORDERDATE >= '@vof(ORDERDATE)' AND
          o.CUSTOMER_ID = c.ID

 
See selecT Query

See Exporting BLOB Data

Stored Procedures:

In addition to the regular queries you can also make stored function calls in this parameter. Depending on the JDBC driver the stored function calls can be made directly or by enclosing within '{' and '}' characters.

Example:

{call my_stored_procedure} 

 

Completion Codes

This Process returns the following completion codes

0 Normal completion
12 An unknown error (probably a JDBC error) is occurred.