I'm having some problems with DBD::ADO and inserting/updating records.

Specifically, after carrying out one of these operations, the number of
records inserted is not returned, which means that it is not possible
to tell if the operation was carried out successfully or not (execute
always returns 0E0, and not the number of rows affected)

This can be reproduced using an ADO connection to both Oracle, and
SQLServer 7

Does anyone know if this is a known bug, or have any suggestions?




-- begin sample code --
use vars qw{
            $ident_num
            $ident_id
           };
$ident_num = 32442;
$ident_id = 'tst_4x_NUL';


my $dbh = <connect to database via ADO using similar to 'dbi:ADO:File
Name=L:\a_filename_here.udl'>

try_insert($dbh);

$dbh->disconnect;



# Insert records
sub try_insert { my ($dbh) = @_;
  my $all_ok = 1;

  my $csr = $dbh->prepare(qq{
                         INSERT INTO
                           table_one
                             (
                             a_number, a_string10
                             )
                         VALUES
                           (
                           ?, ?
                           )
                         });
print "dbh err: ".$dbh->errstr."\n";
  my $exec_ok = 0;
  eval {
    $exec_ok = $csr->execute($ident_num, $ident_id) || 0;
  };

  # If we couldn't create this record, flag error
  # int($exec_ok) gives number of records updated; required as
$exec_ok="0E0"
  # if the insert fails
  if (!(int($exec_ok))) {
    $all_ok = 0;
print "********** Error inserting table_one record
(exec_ok=$exec_ok)\n";
    SQLTestConnect::add_failure();
  }



  $csr->finish();
  return $all_ok;
}

-- end sample code --


Perl:
C:\>perl -v

This is perl, v5.6.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2000, Larry Wall

Binary build 616 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 13:47:17 Jul 14 2000


Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5.0 source
kit.

Complete documentation for Perl, including FAQ lists, should be found
on
this system using `man perl' or `perldoc perl'.  If you have access to
the
Internet, point your browser at http://www.perl.com/, the Perl Home
Page.

Modules:

  DBI v1.27
  DBD::ADO v2.5
 



===================END FORWARDED MESSAGE===================


Reply via email to