SAP jConnect for JDBC supports Transact-SQL queries that include a COMPUTE clause.
select type, price, advance from titles order by type compute sum(price), sum(advance) by type
type price advance ------------ --------- ---------- UNDECIDED NULL NULL Compute Result: ------------------------ ------------------------ NULL NULL type price advance ------------ --------- ---------- business 2.99 10,125.00 business 11.95 5,000.00 business 19.99 5,000.00 business 19.99 5,000.00 Compute Result: ------------------------ ------------------------ 54.92 25,125.00 ... ... (24 rows affected)
When SAP jConnect executes a select statement that includes a COMPUTE clause, SAP jConnect returns multiple result sets to the client. The number of result sets depends on the number of unique groupings available. Each group contains one result set for the detail rows and one result set for the summary. The client must process all result sets to fully process the rows returned; if it does not, only the detail rows of the first group of data are included in the first result set returned.
For more information about the COMPUTE clause, see the SAP Adaptive Server Enterprise Transact-SQL Users Guide. For more information about processing multiple result sets, see the JDBC API documentation on the Oracle Technology Network for Java Web site.