I am querying a table within an oracle database and 
extracting a ton of rows using DBI. Unfortunately.. 
several of the columns in this table will occasionally
be undefined. Hence the resulting array from a fetchrow_array
occasionally has undefined values in it. I am taking this array
and pumping it to another database.. but when I do, I occasionally
get this error...

Use of uninitialized value in concatenation (.) or string at ./audit-logs.pl
line 98.

Any ideas how I can check for uninitialized values in the array 
and set them to something default, or not put those array values 
into the insert statement?

The code is below.

Thanks for any help you can offer.. 
Mike
-----------------------------------------------------------------------

sub pulllogs {

my $result = $oracledbh->do("alter session set nls_date_format='YYYY-MM-DD
HH24:MI:SS'");


        my $oth = $oracledbh->prepare ("select * from sys.aud\$ where
timestamp\# > ? ");
        $oth->bind_param( 1, $timest, { TYPE => 'SQL_DATE' } );
        $oth->execute ();

        while (my @ary = $oth->fetchrow_array() ) {

                my $rows2 = $mysqldbh->do (\"$sid\", \"${ary[0]}\",
\"${ary[1]}\", \"${ary[2]}\", \"${ary[3]}\", \"${ary[4]}\", \"${ary[5]}\",
\"${ary[6]}\", \"${ary[7]}\", \"${ary[8]}\", \"${ary[9]}\", \"${ary[10]}\",
\"${ary[11]}\", \"${ary[12]}\", \"${ary[13]}\", \"${ary[14]}\",
\"${ary[15]}\", \"${ary[16]}\", \"${ary[17]}\", \"${ary[18]}\",
\"${ary[19]}\", \"${ary[20]}\", \"${ary[21]}\", \"${ary[22]}\",
\"${ary[23]}\", \"${ary[24]}\", \"${ary[25]}\", \"${ary[26]}\",
\"${ary[27]}\", \"${ary[28]}\", \"${ary[29]}\")");
        my @ary = ();
        }
        $oth->finish ();
}



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to