Versions Compared

Key

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

...

Here is an image of the form:



This query is included in the configuration.xml.

Code Block
</query>
        <query name="productDetails" autocreate="true">
            <retrieve>
                <!--maps to HTTP GET -->
                <statement> SELECT * from Products order by productName </statement>
            </retrieve>
            <create>
                <statement>INSERT into Products (productCode,productName,productLine,productScale,productVendor,productDescription,quantityInStock,buyPrice,MSRP)
                   VALUES ('{productCode}','{productName}','{productLine}','{productScale}','{productVendor}','{productDescription}',{quantityInStock},{buyPrice},{MSRP})</statement>
            </create>
        </query>

There are 3 ways to insert/update a record in your external database by passing data to the Database Connector.

  1. A Doc URI - this is the simplest way but the Doc URI is only executed when a form is submitted or a flow has completed it’s final step. When the user submits the form, the URI will be executed but now with the POST method selected from the dropdown. The database connector will than execute the Insert operation identified by the URI.

    Code Block
    http://localhost:8082/database/BIRT/productDetails
  2. A Live Forms business rule to pass the data to the database connector post using URL query parameters. One


     

Stored Procedures

You can also execute stored procedures via the database connector. Here is an example of a mySql stored procedure.

...