Skip to content

Instantly share code, notes, and snippets.

@posulliv
Created December 4, 2010 04:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save posulliv/727914 to your computer and use it in GitHub Desktop.
Save posulliv/727914 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'drizzle'
require 'drizzle/connection'
host = "localhost"
port = 4427
db = "data_dictionary"
con_opts = [ Drizzle::INJECTION_PREVENTION ]
conn = Drizzle::Connection.new(host, port, db, con_opts)
query_str = conn.randomize_query("select * from global_variables where variable_name = 'stad_key'")
res = conn.query(query_str)
res.buffer_result
res.each do |row|
puts "#{row[0]} : #{row[1]}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment