The Database Adapter is a powerful tool to expose data and PL/SQL code in your service applications. If you want to quickly service-enable a custom-made query, you definitely may want to explore the â€œExecute Pure SQLâ€ option of the Database Adapter.
This tutorial will show how to service-enable a query step by step using the Database Adapter with Pure SQL.
Business Case: Retrieving Department Information
Assume you have written a query that retrieves information for departments in your database and you want to service-enable this query. The query optionally accepts two arguments: a department ID and a department name. Selection on a part of the department name is possible and selection is case-insensitive. If the arguments are both empty, all departments will be returned by the query.
The query we are talking about here does not only contain columns that are mapped 1-on-1 on database columns but also a concatenation expression and calculated columns using analytical functions. Therefore the â€œExecute Pure SQLâ€ option of the Database Adapter is a logical choice to expose this custom-made query.