Hello,
I'm using DBD::Syabse in a script (which is working just beautifully, thanks to the
authors of DBI and the DBDs - Thank you, people), and I'm doing some
sp_add/droplogin/sp_dropdevice statements. These also work just fine, but print
message regardless of whether I execute() them or do() them...
Device dropped.
Device dropped.
Account locked.
Login dropped.
Password correctly set.
Account unlocked.
New login created.
How may I suppress these messages? (Obviously, I dropped two devices, dropped a
login, and then created a login...)
My connect code:
my $dbh = DBI->connect( $connection, $servers{$server}->{dba},
$servers{$server}->{dbapw}, {RaiseError => 1, AutoCommit => 1} );
My add/drop-login code:
my $sqlStatement = "sp_droplogin $login";
if ($dbh->do($sqlStatement)) { $retval = 1; }
else { print "Could not drop login $login...\n"; }
my $sqlStatement = "sp_addlogin '$login', '$UserPassword'";
if ($dbh->do($sqlStatement)) { $retval = 1; }
else { print "Could not add login $login...\n"; }
My drop device code:
$sqlStatement = "sp_dropdevice '$device'";
if ($dbh->do($sqlStatement)) { $retval = 1; }
else { print "Didn't work... $sqlStatement..\n"; }
Now, if the answer is that I should change the RaiseError to 0, then I'll just live
with the messages, as I prefer to know that the script execution went bad...
Thanks,
amonotod
--
`\|||/ amonotod@ | sun|perl|windows
(@@) charter.net | sysadmin|dba
ooO_(_)_Ooo____________________________________
_____|_____|_____|_____|_____|_____|_____|_____|