Guest User

Untitled

a guest
Jun 19th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. >> db = TinyTds::Client.new :username => 'USER', :password => 'PASSWORD', :dataserver => 'SERVER', :database => 'DB', :encoding => 'UTF-8'
  2. => #<TinyTds::Client:0x101174a88>
  3. >> db.encoding
  4. => nil
  5. >> r = db.execute "insert into awards (title) values ('Japanese')"
  6. => #<TinyTds::Result:0x101167810>
  7. >> r.each
  8. => []
  9. >> r = db.execute "insert into awards (title) values ('Japanese 日本語です')"
  10. => #<TinyTds::Result:0x101155188>
  11. >> r.each
  12. => []
  13. >> r = db.execute "select * from awards where id = 28"=> #<TinyTds::Result:0x10114d258>
  14. >> r.each
  15. => [{"label"=>nil, "created_at"=>nil, "title"=>"Japanese ?????", "updated_at"=>nil, "id"=>28, "has_scores"=>false, "description"=>nil, "award_type_id"=>nil}]
  16. >> r.first['title']
  17. => "Japanese ?????"
  18. >> $KCODE
  19. => "UTF8"
Add Comment
Please, Sign In to add comment