Skip to content

Instantly share code, notes, and snippets.

@alcabanillas-engh
Created December 4, 2008 00:37
Show Gist options
  • Save alcabanillas-engh/31788 to your computer and use it in GitHub Desktop.
Save alcabanillas-engh/31788 to your computer and use it in GitHub Desktop.
#Note: did not work with SQL Server, will work with Oracle, MySQL
#require AR
require 'rubygems'
require 'active_record'
# connect to the Database
ActiveRecord:: Base.establish_connection(
:adapter => "oracle",
:host => "10.0.1.22",
:database => "xe",
:username => "prep",
:password => "passwd"
)
#define a simple model
class Outboundservice < ActiveRecord::Base
set_table_name "PCO_OUTBOUNDSERVICE" # comment out if not using oracle
end
begin
record = Outboundservice.find(:first)
puts record.inspect
rescue => err
puts err
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment