Hello everybody,
I am currently working on a database system that utilizes ruby on
rails
with a oracle database. Here’s the situation:
the ruby on rails web application is up and running (scaffolds have
been generated);
my oracle database is full of tables that are populated with data;
there is a successful connection between rails and my oracle database;
however, what still needs to be done is I currently have sql
statements/queries in which I am using to mine data from my database
(eg. “find minimum time someone has been employed”
Select min(time) from table…etc)
What I need to do is write a ruby application (one for each sql
statement), where the sql statement is hardcoded into the ruby code.
I need the ruby code to:
- connect to the oracle database
- run the sql statement on the oracle database
- take the results and return them in an array or
something of that nature (so that they can be used in an html file for
output on the web application)
If someone could give me a skeleton of how this should look in ruby or
give me example code I would forever be in your debt.
Thanks