Guest User

Untitled

a guest
Jul 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. require 'rubygems'
  2. require 'drizzle'
  3. require 'drizzle/connection'
  4.  
  5. host = "localhost"
  6. port = 4427
  7. db = "data_dictionary"
  8. con_opts = [ Drizzle::INJECTION_PREVENTION ]
  9.  
  10. conn = Drizzle::Connection.new(host, port, db, con_opts)
  11. query_str = conn.randomize_query("select * from global_variables where variable_name = 'stad_key'")
  12. res = conn.query(query_str)
  13. res.buffer_result
  14. res.each do |row|
  15. puts "#{row[0]} : #{row[1]}"
  16. end
Add Comment
Please, Sign In to add comment