Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails console sql query only returns true

I am issuing an SQL statement in console:

> sql = "SELECT flavour from Libation where id=8675309"
> result = ActiveRecord::Base.connection.execute(sql)
=> true

Am using the oracle enhanced adapter, and wonder why I only get true. I was expecting something like "mango". I have tried many things and no luck.

like image 1000
rtfminc Avatar asked May 17 '26 10:05

rtfminc


1 Answers

Use select_all instead of execute to fetch results.

like image 98
nishu Avatar answered May 20 '26 00:05

nishu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!