I'm using ActiveRecord's connection to execute a custom query (which
runs fine in psql) like this:
>> result = ActiveRecord::Base.connection.execute("COPY (select * from users)
>> TO STDOUT WITH CSV;")
SQL (0.8ms) COPY (select * from users) TO STDOUT WITH CSV;
=> #<PGresult:0x2589ad8>
>> result.nfields
=> 39
>> result.ntuples
=> 0
An instance of PGresult is returned. How can I get data out of it?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---