Zubatman
Zubatman

Reputation: 1305

Connecting to an Oracle Database from Rails 4

I have to do a query into an Oracle Database (11g) to extract an HTML file that is stored as a BLOB (yes BLOB, not CLOB) from my Rails 4 Application. So far while working with this database, since it is not well designed, I have been using a number of workarounds to get what I need to out of it. Unfortunately these are no longer working properly, and it would appear that the easiest way to get the HTML file, to later render in my Rails App, would just be to query the Oracle DB for it.

I have googled around on this issue, but everything I have found on the matter with any body to it is from a couple of years ago and no longer of much use to me. So I was wondering if anyone could tell me the best way to connect to an Oracle 11g Database for a single query from a Rails 4 Application / point me in the right direction to find documentation that will help me accomplish this.

Important to Reiterate: I am not trying to get this working with ActiveRecord as my primary DB for my app, instead I need to send one query and manipulate the response of that query.

Upvotes: 1

Views: 383

Answers (1)

Zubatman
Zubatman

Reputation: 1305

The ruby-OCI8 gem can be configured to make a single SQL query to an Oracle Database, the docs have instructions on how to set up the necessary Oracle Instant Client.

Upvotes: 1

Related Questions