According to Tanel Poder's blog post here , calling DBMS_RESOURCE_MANAGER.SWITCH_CONSUMER_GROUP_FOR_SESS (sid, serial#, 'CANCEL_SQL'); (where sid and serial # identify the session is being interrupted) may work, but it did not test it.
If your application can make OCICancel() or jdbc Statement.cancel calls, this might work as well.
In any case, I'm not sure how to get the status of the lines already read; terminating a SQL * Plus session in which buffering output will tell you how many rows it has, but if it did not start buffering output, it will not.
source share