Method: WIKK::SQL.each_param
- Defined in:
-
lib/wikk_mysql2.rb,
lib/wikk_ruby_mysql.rb
@result and @affected_rows are also set via call to query().
Create WIKK::SQL instance and set up the mySQL connection, and Run a query on the DB server. Yields query result row by row, as Hash using Symbol keys, so can’t have table names included.
This can be used with keyword arguments. eg. each_sym { |key1:, key2:, …, **rest_of_args| do something }
373 374 375 376 377 378 379 380 381 382 |
# File 'lib/wikk_mysql2.rb', line 373 def self.each_param(db_config, query, &block) self.connect( db_config ) do |sql| if block_given? sql.each_param(query, &block) return sql # May be useful to access the affected rows else return sql.each_sym(query) end end end |