Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invoking salesforce query and querymore operation from Oracle BPEL

764713Nov 23 2010 — edited Feb 27 2020
Since salesforce has a limitation in query operation, that it cannot send more than 10K rows, they have advised us to use querymore operation as well. So after invoking query operation, the querymore operation has to be invoked iteratively to get the complete set of data.
Now, from Oracle BPEL, query operation can be invoked , but has anybody tried to invoke querymore? Salesforce has supplied a Java code , which uses a querylocator object, the code is below. Can you please let me know if you have tried something equivalent to this Java code from Oracle BPEL.
private void querySample() {
QueryResult qr = null;
QueryOptions qo = new QueryOptions();
qo.setBatchSize(250);
binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(),
"QueryOptions", qo);
try {
qr = binding.query("select FirstName, LastName from Contact");
boolean done = false;
if (qr.getSize() > 0){
System.out.println("Logged-in user can see " + qr.getRecords().length +
" contact records.");
while (!done) {
for (int i=0;i<qr.getRecords().length;i++) {
Contact con = (Contact)qr.getRecords(i);
String fName = con.getFirstName();
String lName = con.getLastName();
if (fName == null)
System.out.println("Contact " + (i + 1) + ": " + lName);
else
System.out.println("Contact " + (i + 1) + ": " + fName + " " + lName);
}
if (qr.isDone()) {
done = true;
} else {
qr = binding.queryMore(qr.getQueryLocator());
}
}
}
else {
System.out.println("No records found.");
}
System.out.println("\nQuery succesfully executed.");
}
catch (RemoteException ex) {
System.out.println("\nFailed to execute query successfully, error message was: \n" +
ex.getMessage());
}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 21 2010
Added on Nov 23 2010
0 comments
347 views