Advertisement
Advertisement
| 05.30.2008 at 10:25AM PDT, ID: 23445332 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: |
#!/apps/perl5.8/bin/perl -wT
use DBI;
use DBD::Sybase;
#this is how you connect to MS SQL Server 2005:
my $DSN = 'driver={SQL Server};Server=192.111.17.91; database=FACSOLAPCore;uid=c
ibna\x582406;pwd=Apr-2008;';
my $dbh = DBI->connect("dbi:ODBC:$DSN") or die "Database connection not made: $D
BI::errstr\n";
#this is how you query the db:
# query the database
my $sql = qq{ SELECT * FROM Inventory };
my $sth = $dbh->prepare( $sql );
|