DBD::Sybase message suppression....

From: Amonotod (amonotod_at_charter.net)
Date: 07/21/04


To: <dbi-users@perl.org>
Date: Wed, 21 Jul 2004 21:06:49 +0000

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____________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


Relevant Pages

  • problems with motd
    ... I've got some problems with motd as following description: ... After logging in system, messages: last login. ... According to the man page for motd, use touch ~/.hushlogin can suppress those messages besides the last login part. ...
    (freebsd-questions)
  • Re: problems with motd
    ... > 1.so I just want to know how to suppress the last login part? ... No idea off the top of my head -- my logins don't do this. ... To unsubscribe, ...
    (freebsd-questions)
  • Re: Best authentication methods for CGI <- PERL -> DBI
    ... What are some best practices on an initial form taking a PW/ID from a ... user to login. ...
    (perl.dbi.users)