Hi All,

I am reading in a pipe delimited file and using the while loop and
$sth->execute, I am trying to insert into a table, but am getting the
following error:

Bad int8 external representation "" (SQL-HY000) (DBD:
st_execute/SQL_Execute err=-1

Here is my sub-routine:

  sub sub_executeBindFromInputFile($$$$) {
    local ($dbDriver, $dbh, $sth, $fh) = @_;
    my ($bindVar, @row);
    my $count = 0;
    $delimiter ||= "|";
    $COMMITPOINT ||= 10000;
    while (<$fh>) {
      chomp;
      @row = split(/\|/, $_);
      unless ($sth->execute(@row)) {
        $MESSAGE = $DBI::errstr;
        $STATUS = $FAILURE;
        sub_exit("Y", $dbDriver, $dbh);
        }
      if ($destIsOracle) {
        $count++;
        if ($count >= $COMMITPOINT) {
          $s_dbh->commit || die "$DBI::errstr\n";
          $count = 0;
          }
        }
      }
    print STDERR "RETURN STATEMENT HANDLE IS: $sth\n\n";
    return($sth);
    } #<=== (End of sub_executeBindFromInputFile)

When I handle the insert directly out of a select, it appears to work. 
Can you please tell me what I am doing wrong?

Thanks.

Peter


Peter Loo
Worldwide Consulting, Inc.
Phoenix, Arizona
U.S.A.

Reply via email to