Yes, definitely use DBI.
Here's a few lines from one of my old scripts that read from a sybase. The environment stuff is important. IIRC, it will be the same even if you're using the freetds libs.
use DBI; BEGIN { # path to sybase or freetds libs $ENV{'SYBASE'} = "/opt/sybase"; # Sybase server as listed in your 'interfaces' file $ENV{'DSQUERY'} = "server.host.name"; } my (@available_drivers, $dbh, $sql_statement, $sth, @array) = (); my $username = "dbusername"; my $password = "dbpassword"; my $dbh = DBI->connect('dbi:Sybase:', $username, $password);
After that, you're good to go with normal DBI methods straight from the docs.
--
"A long habit of not thinking a thing wrong, gives it a superficial appearance of being right." -- Thomas Paine
naChoZ
In reply to Re: how to parse output from isql utility
by naChoZ
in thread how to parse output from isql utility
by reuben12
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |