# \`exec': wrong number of arguments (0 for 1) (ArgumentError)

**URL:** <https://www.ruby-forum.com/t/exec-wrong-number-of-arguments-0-for-1-argumenterror/196283>\
**Category:** Ruby\
**Created:** [October 10, 2010, 9:22pm UTC](https://www.ruby-forum.com/t/exec-wrong-number-of-arguments-0-for-1-argumenterror/196283 "2010-10-10T21:22:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![snarain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e95f7d/32.png) [@snarain](https://www.ruby-forum.com/u/snarain)\
**Post date:** [October 10, 2010, 9:22pm UTC](https://www.ruby-forum.com/t/exec-wrong-number-of-arguments-0-for-1-argumenterror/196283/1 "2010-10-10T21:22:37Z")

</div>

Hi All,

I’m new to ruby and I’m facing one issue when connecting to Oracle 11g  
database from a ruby program…

conn = OCI8.new(‘user’, ‘passwd’, ‘db’)  
cursor = conn.parse(“SELECT SUB\_ID FROM LOOKUPS WHERE TYPE LIKE  
‘CHANNEL\_TYPE’ and LOWER(TRIM(name)) = :channelType”)  
cursor.bind\_param(’:channelType’, channelType.downcase)  
cursor = conn.exec()

I’m getting `exec’: wrong number of arguments (0 for 1) (ArgumentError)  
on the last line. My ruby version is 1.8.7 and OS is Ubuntu 10.04.

Can someone pls help me?

---

<div class="post-metadata">

**Author:** ![snarain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e95f7d/32.png) [@snarain](https://www.ruby-forum.com/u/snarain)\
**Post date:** [October 11, 2010, 7:38am UTC](https://www.ruby-forum.com/t/exec-wrong-number-of-arguments-0-for-1-argumenterror/196283/2 "2010-10-11T07:38:30Z")

</div>

My bad it should have been  
cursor.exec() and not conn.exec()
