in reply to how to parse output from isql utility
This should get you started (UNTESTED):
update: note that I don't need the $count variable at all. It's just there because you specified it in your post. In perl, this is generally true; most looping constructs do not need a count. see also the perlsyn manpageuse DBI; my $dbh = DBI->connect( @some_connect_info, { RaiseError => 1 } ); my ($count) = $dbh->fetchrow_array("COUNT * FROM table"); my $sth = $dbh->prepare("SELECT col1,col2 FROM table"); $sth->execute(); while (my $res = $sth->fetchrow_hashref) { # in this block # value1 == $res->{col1}; # value2 == $res->{col2}; }
|
|---|