M
mattjones
hi,
Im having trouble loading a .log file into oracle. I can connect to the
database and i can insert data (that i define in an INSERT statement).
I eventually need to filter specific info from the .log files (there
are alot of them - and this script provides an automated process) but
for now i just want to read the whole script into a table!
CURRENT SCRIPT:
#!/usr/central/bin/perl -w
use strict;
use DBI;
my $dbh = DBI ->connect("dbi:Oracle:SERVER", "DATABASE", "PASSWORD")
or die "Couldn't connect to database: $DBI::errstr\n";
my $rows = $dbh->do("
INSERT INTO LOGS VALUES ('160820061-fst.log', '5', '0', 'FASTSEARCH',
'0', 'inversions', '0', 'conflicting') ");
$dbh->disconnect;
exit;
##### I have also tried the following and putting $LOG into one of the
values but I just get the value '1' returned!
my $LOG = open (LOG, "/home/USRNAME/PERL/hello.log");
my @data = <LOG>;
close LOG;
Any ideas?
Thanks
Im having trouble loading a .log file into oracle. I can connect to the
database and i can insert data (that i define in an INSERT statement).
I eventually need to filter specific info from the .log files (there
are alot of them - and this script provides an automated process) but
for now i just want to read the whole script into a table!
CURRENT SCRIPT:
#!/usr/central/bin/perl -w
use strict;
use DBI;
my $dbh = DBI ->connect("dbi:Oracle:SERVER", "DATABASE", "PASSWORD")
or die "Couldn't connect to database: $DBI::errstr\n";
my $rows = $dbh->do("
INSERT INTO LOGS VALUES ('160820061-fst.log', '5', '0', 'FASTSEARCH',
'0', 'inversions', '0', 'conflicting') ");
$dbh->disconnect;
exit;
##### I have also tried the following and putting $LOG into one of the
values but I just get the value '1' returned!
my $LOG = open (LOG, "/home/USRNAME/PERL/hello.log");
my @data = <LOG>;
close LOG;
Any ideas?
Thanks