jorgevaldivia / salesforce_bulk

Simple Salesforce Bulk API interface
53 stars 85 forks source link

Errors when parsing returned results #11

Open terryroe opened 12 years ago

terryroe commented 12 years ago

I am trying to use the salesforce_bulk gem to query our Salesforce instance. I can log in successfully, but when I query I get the following results, or similar:

res = salesforce.query("Account", "SELECT id, name FROM Account LIMIT 1")
CSV::IllegalFormatError: CSV::IllegalFormatError
    from /Users/terry/.rbenv/versions/1.8.7-p358/lib/ruby/1.8/csv.rb:607:in `get_row'
    from /Users/terry/.rbenv/versions/1.8.7-p358/lib/ruby/1.8/csv.rb:556:in `each'
    from /Users/terry/.rbenv/versions/1.8.7-p358/lib/ruby/1.8/csv.rb:127:in `collect'
    from /Users/terry/.rbenv/versions/1.8.7-p358/lib/ruby/1.8/csv.rb:127:in `parse'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk/job.rb:132:in `parse_results'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk/job.rb:123:in `get_batch_result'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk.rb:60:in `do_operation'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk.rb:35:in `query'
    from (irb):2

Or this:

res = salesforce.query("Account", "SELECT id FROM Account LIMIT 1")
TypeError: can't convert String into Integer
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk/job.rb:141:in `[]'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk/job.rb:141:in `parse_results'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:182:in `each_with_index'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk/job.rb:134:in `each'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk/job.rb:134:in `each_with_index'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk/job.rb:134:in `parse_results'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk/job.rb:123:in `get_batch_result'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk.rb:60:in `do_operation'
    from /Users/terry/.rbenv/versions/1.8.7-p358/gemsets/pcwi-sf-services/gems/salesforce_bulk-1.0.0/lib/salesforce_bulk.rb:35:in `query'
    from (irb):3

Any help on resolving these would be greatly appreciated.

Thanks,

TR

imranansari commented 11 years ago

were you able to resolve this issue?

terryroe commented 11 years ago

Imran,

I ended up not using this gem. I never did find an answer.

TR

On Fri, Jun 28, 2013 at 12:35 PM, Imran Ansari notifications@github.comwrote:

were you able to resolve this issue?

— Reply to this email directly or view it on GitHubhttps://github.com/jorgevaldivia/salesforce_bulk/issues/11#issuecomment-20199270 .

imranansari commented 11 years ago

I ended up at https://github.com/javierjulio/salesforce_bulk, are you using that?, i'm unable to find a Query example

thanks!

terryroe commented 11 years ago

Imran,

I ended up using the Salesforce REST api.

TR

On Fri, Jun 28, 2013 at 12:49 PM, Imran Ansari notifications@github.comwrote:

I ended up at https://github.com/javierjulio/salesforce_bulk, are you using that?, i'm unable to find a Query example

thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/jorgevaldivia/salesforce_bulk/issues/11#issuecomment-20200076 .

mzrzvi commented 9 years ago

I'm having this issue now too... I have not resolved it

mzrzvi commented 9 years ago

I figured it out! I was using Ruby 1.8.7 which seems to be unsupported. Ran the exact same code in 1.9.3 and it works just as expected!