Defining a WHERE Clause

Oracle JCA Adapter for Database 9-19 Figure 9–18 Expression Builder To model more complex WHERE clauses sub selects and functions, and to add ORDER BY clauses, you can edit the SQL procedure manually and click Next. However, this creates maintenance overhead later on, due to hard-coded SQL, and you may lose platform independence. You can change the columns listed in the FROM clause as long as the number of columns and the types of each remain unchanged. For more complex changes consider using the Execute Pure SQL option directly where you can type any SQL. Return Single Result Set You must select Use Outer Joins to return a Single Result Set for both Master and Detail Tables in the Define Selection Criteria page to use an advanced feature that influences how many total statements TopLink uses when querying against multiple related tables. The safest method is to use the default 1 per table, and this feature will attempt 1 total, by outer joining all related tables into a single result set. See Section 9.2.10, Choosing an After-Read Strategy to continue using the Adapter Configuration Wizard.

9.2.10 Choosing an After-Read Strategy

If you selected Perform an Operation on a Table, then you can skip ahead to the Section 9.2.12, Specifying Advanced Options. . When configuring an inbound operation, you have the following options about what to do after a row or rows have been read: ■ Section 9.2.10.1, Delete the Rows That Were Read ■ Section 9.2.10.2, Update a Field in the Table Logical Delete ■ Section 9.2.10.3, Update a Sequencing Table ■ Section 9.2.10.4, Update an External Sequencing Table on a Different Database ■ Section 9.2.10.5, Update a Sequencing File 9-20 Oracle Fusion Middleware Users Guide for Technology Adapters Figure 9–19 shows these options. Figure 9–19 The Adapter Configuration Wizard: After Read Page See Section 9.4.2.2, Polling Strategies to continue using the Adapter Configuration Wizard.

9.2.10.1 Delete the Rows That Were Read

With this option, the rows are deleted from the database after they have been read and processed by the adapter service.

9.2.10.2 Update a Field in the Table Logical Delete

With this option, you update a field in the root database table to indicate that the rows have been read. The WHERE clause of the query is updated automatically after you complete the configuration, as shown in Figure 9–20 . Oracle JCA Adapter for Database 9-21 Figure 9–20 The Adapter Configuration Wizard: Logical Delete Page When you use this approach, your database table appears, as shown in Figure 9–21 . Figure 9–21 Updating Fields in a Table Note the following: ■ Rows 150 and 153 have been previously read and processed. ■ At the next polling event, row 152 is read and processed because it contains UNPROCESSED in the Status column. Because an explicit Unread Value was provided, row 151 is not read. ■ Row 154 has been flagged as LOCKED and is not read. You can use this reserved value if your table is used by other processes.

9.2.10.3 Update a Sequencing Table

With this option, you are keeping track of the last-read rows in a separate sequence table. Figure 9–22 shows the information you provide. The WHERE clause of your query is updated automatically after you complete the configuration.