Have you heard about using Inspector? You can access it by going to Manage->Core Administration->Inspector.
You may need to have privileges to use it. But there is a way to enter Ariba Query Language statements into Inspector and you have a class browser. It's very helpful for running ad hoc queries without having to know the details of the tables in oracle. You will need to understand taht there is a PUrchase Order and POLineItem, but not that Oracle actually has 7 physical tables that make up a PurchaseOrder.
Not sure this helps you, but Inspector is the most common way to run ad hoc queries, at least for On Premise customers.
Mike