+ Start a Discussion
Joseph FerraroJoseph Ferraro 

getting duplicates using queryMore

I'm doing a query to pull a few hundred thousand records from a custom object and I'm noticing duplicate rows being pulled down.  I'm sure this is something I'm doing wrong, but I'm using the queryMore sample code provided in the wiki

 

 

QueryResult queryResult = this.stub.query("Select name From lead"); do { for(sObject lead : queryResult.getRecords()) { System.out.println(lead.get_any()[0].getValue()); } if(queryResult.isDone()) break; queryResult = this.stub.queryMore(queryResult.getQueryLocator()); } while(true);

 

 I am performing a few different queries within my class, so I'm repurposing queryResult, but I'm setting it to null before every query.

 

Any help is appreciated!

 

mpiercempierce
Do you have more than one lead with the same name?
Joseph FerraroJoseph Ferraro
FWIW this only happened once and never happened again...I'm thinking it was user error somewhere along the line, but I have not pinpointed it.