Skip to content

Instantly share code, notes, and snippets.

@alcabanillas-engh
Created November 22, 2008 21:52
Show Gist options
  • Save alcabanillas-engh/27950 to your computer and use it in GitHub Desktop.
Save alcabanillas-engh/27950 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",
:database => "172.30.10.140/xe",
:username => "prep",
:password => "pass"
)
#define a simple model
class PcoOutboundqueue < ActiveRecord::Base
set_table_name "PCO_OUTBOUNDQUEUE" # comment out if not using oracle
end
begin
record=PcoOutboundqueue.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