Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Writing rules with http.post and http.put requests eliminates the need to use a Stored procedure to update/insert records into your database tables and then call that Stored Procedure from a business rule.

Stored Procedures

You can also execute stored procedures via the database connector. The Database Connector supports the use of Stored Procedures to update/insert data into a database table. Existing stored procedures can still be used. Using the Post/Put to the Database Connector from a Business Rule accomplishes the same thing and is a more straight forward approach than using a stored procedure.

To use a stored procedure, you must:

  • Create a stored procedure to update/insert the values into the database table
  • Call this stored procedure in the <retrieve> tag of your configuration.xml query
  • Use an http.get statement in your business rule to call this query. The stored procedure will execute and update/insert data to your table

Here is an example of a mySql stored procedure.

...

To call this from the mySql command line you would use the command: call GetNewOrderNum(); To call this from the database connector you would add the following to the configuration.xml:

Code Block
<query name="getOrderNumber">
    <retrieve>
        <statement> w
            call GetNewOrderNum() 
        </statement> 
   </retrieve> 
</query>

...