IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > JDBC > Overview of IBM WebSphere Adapter for JDBC > Technical overview > Outbound processing > Outbound operations
DeleteAll operation
The DeleteAll operation deletes multiple database records at a time, and returns the record count to indicate how many records have been deleted.
To process the DeleteAll operation, the adapter performs the following actions:
- Uses the attributes of the input table business object to generate an SQL statement.
- Executes the generated SQL statement to delete all records that match the attributes set in the business object.
If the business object is hierarchical, only the top-level business object (the individual business object at the top of a hierarchical business object) is deleted. If the operation violates the data integrity constraints in the database, the adapter returns the IntegrityConstraint fault. To avoid this exception, you must execute the DeleteAll operation multiple times in a specific order for the hierarchical business object.
For example, if the CUSTINFO table has a foreign-key reference on the CUSTOMER table, then you must execute a DeleteAll operation on the business object of CUSTINFO table first, and then execute a DeleteAll operation on the business object of the CUSTOMER table.
- Obtains the execution result of the delete SQL statement, and sets the recordcount attribute on the DeleteAllResult business object.
For example, if the adapter determines that there are 10 records that have been deleted, it sets the recordcount parameter to recordcount=10.
If there are no records matching the query rule, then no records are deleted, and the recordcount output parameter is 0.
If you want the adapter to return RecordsNotFoundException when records no records are affected during the UpdateAll or DeleteAll operation, you must select the Return exception when no records are affected during UpdateAll or DeleteAll operation check box in the Specify Composite Properties window of the external service wizard.
You can use the SQL capabilities to full extent for querying records by using child business object attributes or user-defined query criteria for operations.
Related concepts:
User-defined query criteria for operations
Matching records using child business object attributes
Related tasks:
Setting global properties for operations and creating wrapper business objects
Related reference: