Guest User

Untitled

a guest
Feb 21st, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #Note: did not work with SQL Server, will work with Oracle, MySQL
  2. #require AR
  3. require 'rubygems'
  4. require 'active_record'
  5.  
  6. # connect to the Database
  7. ActiveRecord:: Base.establish_connection(
  8. :adapter => "oracle",
  9. :host => "10.0.1.22",
  10. :database => "xe",
  11. :username => "prep",
  12. :password => "passwd"
  13. )
  14.  
  15. #define a simple model
  16. class Outboundservice < ActiveRecord::Base
  17. set_table_name "PCO_OUTBOUNDSERVICE" # comment out if not using oracle
  18. end
  19.  
  20. begin
  21. record = Outboundservice.find(:first)
  22. puts record.inspect
  23. rescue => err
  24. puts err
  25. end
Add Comment
Please, Sign In to add comment