The driver exposes reports defined on an Oracle Service Cloud instance as stored procedures. An application can obtain a list of the reports defined on an Oracle Service Cloud instance by calling the DatabaseMetaData.getProcedures method. The names of the reports that can be invoked through the driver are listed in the PROCEDURE_NAME name column of the getProcedures() results.
The driver incorporates report name and unique report ID into the procedure name reported by getProcedures(). The driver creates the reported procedure name by appending the report ID to the report name using an underscore (_) to join them. Additionally, any spaces in the report name are replaced with an underscore character. The report name is also prepended with RN if the report starts with a digit. Like all identifier name metadata returned by the driver, the procedure name is uppercase. For example, a report named Contact Lookups would be modified as follows:
CONTACT_LOOKUPS_14001
An application invokes a report using the standard Call escape syntax:
And JDBC mechanisms are used for calling a stored procedure that returns a result set. The following example shows one way to invoke the Contact Lookups report:
String sql = "{call CONTACT_LOOKUPS_14001('[Contact ID] < 10')}";
CallableStatement callStmt = con.prepareCall(sql);
boolean isResultSet = callStmt.execute();
if (isResultSet)
{ resultSet = callStmt.getResultSet(); // process the resultset }
In this example, the standard Call escape syntax is employed for the Opportunities report: