Never tried this before, I am trying to execute a sql query from within a Ruby Cucumber Step definition . Not at all sure what to do after the connection made.
Connection (Works)
Then(/^TC-0001-Bill-Of-Laiding Query onleLisa (Lisa_One) to access existing Bill Of laiding Order$/) do
conn = DBI.connect('DBI:ODBC:GPAutomation','XXXXX','XXXXX')
conn.connected?
Framework Setup
require 'rubygems'
require 'watir-webdriver'
require 'watir'
require 'rspec'
require 'cucumber'
require 'selenium-webdriver'
require 'win32ole'
require 'rufus/scheduler'
require 'yaml'
require 'dbi'
The Query that I want to execute
select h.bol_id, * from bol_header h (nolock)
inner join bol_header_info hi (nolock) on h.bol_id = hi.bol_id
where h.facility_id = '505' and h.Status = 'O' and hi.order_type = 'S'
Any Pro tips would be greatly appreciated …