On Thursday, March 10, 2016 at 7:52:47 PM UTC-8, Jeremy Swartwood wrote:
>
> I am using OCI8 and SEQUEL to execute a stored procedure against Oracle.
>

Just FYI, SEQUEL (all caps) was a precursor to SQL.  When referring to the 
ruby library, use Sequel.
 

> I can connect and retrieve data with SEQUEL, but when I run the stored 
> procedure, the return value is "1".
>
> It appears SEQUEL doesn't like the 1 coming back from the stored procedure?
>

Correct.  When you call Dataset#each, the dataset is supposed to return 
rows, not a Fixnum.
 

>
> The 1 causes the following error:
>
> /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sequel-4.32.0/lib/sequel/adapters/oracle.rb:92:in
>  
>> `ensure in block in _execute': undefined method `close' for 1:Fixnum 
>> (NoMethodError)
>>         from 
>> /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sequel-4.32.0/lib/sequel/adapters/oracle.rb:92:in
>>  
>> `block in _execute'
>>         from 
>> /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sequel-4.32.0/lib/sequel/database/connecting.rb:251:in
>>  
>> `block in synchronize'
>>         from 
>> /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sequel-4.32.0/lib/sequel/connection_pool/threaded.rb:105:in
>>  
>> `hold'
>>         from 
>> /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sequel-4.32.0/lib/sequel/database/connecting.rb:251:in
>>  
>> `synchronize'
>>         from 
>> /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sequel-4.32.0/lib/sequel/adapters/oracle.rb:77:in
>>  
>> `_execute'
>>         from 
>> /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sequel-4.32.0/lib/sequel/adapters/oracle.rb:67:in
>>  
>> `execute'
>>         from 
>> /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sequel-4.32.0/lib/sequel/dataset/actions.rb:952:in
>>  
>> `execute'
>>         from 
>> /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sequel-4.32.0/lib/sequel/adapters/oracle.rb:364:in
>>  
>> `fetch_rows'
>>         from 
>> /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sequel-4.32.0/lib/sequel/dataset/actions.rb:141:in
>>  
>> `each'
>>         from 
>> /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/etl-0.1.0/lib/etl/load_accounts.rb:38:in
>>  
>> `run'
>>         from ./load_accounts:104:in `<main>'
>
>
Change line 38 of load_accounts.rb from calling Dataset#each to calling 
Database#run with the SQL.
 
Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to