Accessing Pervasive.SQL With Perl

Page Last Modified:

Home Links ODBC (DBI) Contact

use strict;
use warnings;
use DBI;

eval {
print "Connecting to database...\n";
my $dbHandle = DBI->connect('dbi:ODBC:DEMODATA', '', '', {PrintError=>0,RaiseError=>1});

print "Preparing statement...\n";
my $stHandle = $dbHandle->prepare("DELETE FROM Course WHERE Name = 'PERL01'");

print "Running delete...\n";
my $ret = $stHandle->execute();
print "$ret row(s) deleted...\n";

print "Disconnecting...\n";
$dbHandle->disconnect();
1;
}
or do {
print "Error: $DBI::err - $DBI::errstr\n";
};

print "Finished\n";

Home Links ODBC (DBI) Contact

All content on this site is copyright
Neil Hughes 2010 - 2017

use strict;
use warnings;
use DBI;

eval {
print "Connecting to database...\n";
my $dbHandle = DBI->connect('dbi:ODBC:DEMODATA', '', '', {PrintError=>0,RaiseError=>1});

print "Preparing statement...\n";
my $stHandle = $dbHandle->prepare("DELETE FROM Course WHERE Name = 'PERL01'");

print "Running delete...\n";
my $ret = $stHandle->execute();
print "$ret row(s) deleted...\n";

print "Disconnecting...\n";
$dbHandle->disconnect();
1;
}
or do {
print "Error: $DBI::err - $DBI::errstr\n";
};

print "Finished\n";

DBI + ODBC - Delete Example