- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- DBI-Oracle
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2003 09:52 AM
тАО05-12-2003 09:52 AM
I am getting errors when I execute this code, if I replace $Logevent with a text it
works fine but I am not sure why it is giving errors. This is a simple code which will
test the database is up or down, if it is down I want to create a event in the event
log on NT. Here is the script ...
$ cat dbamon.pl
#!C:\perl\ActivePerl\Perl\bin\perl -w
use strict;
use DBI;
my $dbh = DBI->connect( 'dbi:Oracle:db1',
'test',
'test',
{
RaiseError => 1,
AutoCommit => 0
}
) || die "Database connection not made: $DBI::er
rstr";
my $sql = qq( SELECT status from test );
my $sth = $dbh->prepare( $sql );
$sth->execute();
my( $status);
$sth->bind_columns(undef, \$status);
$Logevent=`C:/perlwork/logevent -s E -r "Backup Event" -e 42 "Producti
on Database is down"`
while( $sth->fetch() ) {
if($status eq "Success")
{print "$status:Good\n"};
else
{print "$Logevent"};
}
$sth->finish();
$dbh->disconnect();
$ ./dbamon.pl
Global symbol "$Logevent" requires explicit package name at C:\perlwor
k\dbamon.pl line 22.
syntax error at C:\perlwork\dbamon.pl line 24, near ") {"
Execution of C:\perlwork\dbamon.pl aborted due to compilation errors.
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2003 10:02 AM
тАО05-12-2003 10:02 AM
Re: DBI-Oracle
on Database is down"`
Aren't those supposed to be "\", not "/"?
Regards.
RZ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2003 10:34 AM
тАО05-12-2003 10:34 AM
Re: DBI-Oracle
$Logevent=`logevent -s E -r "Backup Event" -e 42 "Producti
on Database is down"`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2003 02:14 PM
тАО05-12-2003 02:14 PM
Re: DBI-Oracle
$dbh->trace (9);
?
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2003 02:16 PM
тАО05-12-2003 02:16 PM
Solution$dbh->trace (9);
?
Ah, and the warning is because you didn't declare $Logevent as lexical:
my $Logevent=`C:/perlwork/logevent -s E -r "Backup Event" -e 42 "Producti
on Database is down"`
BTW
my $status;
does not need parentheses
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2003 06:26 PM
тАО05-12-2003 06:26 PM