require 'win32ole'
require_relative 'SqlServer'
#Select
db = SqlServer.new
db.open
test = db.query("
SELECT TOP *
FROM testdb
WHERE Flag = 'Y'
")
db.close
puts test
------
So if I do 'puts test' I get everything that's bought back from the query,
if I do 'puts test[0]' then I just get the first row.
How would I bring back a more specific value. e.g. first column, first row?
On Thursday, 27 September 2012 08:37:02 UTC+1, Adrian Killens wrote:
>
> Hi There,
>
> Does anyone know how to select a specific value from a database?
> I'm running a query that returns a few rows and columns but if I want to
> output a specific value, e.g. row1, col2. How would I do that?
>
> Cheers
> Aidy
>
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]