On Fri, 08 Nov 2002 09:28:43 +0000, Simon Oliver wrote:

> oliver wrote:
>  > 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)
>  >
> You could use a client side cursor.
> 
> But execute should raise error if the insert failed - just wrap execute in 
> an eval to test if the insert was successfull.
> 

This is only true if RaiseError(s) is enabled and an exception was raised.

It is not true for an subselect inserts or updates that can operate
quite sucessfully on empty sets.

i.e.
my $rc = $dbh->do('update tablename set A=2 wherte B like ?',{}, 'aaa%');

or
my $rc = $dbh->do('insert into tablename (a,b)
select a+2,b where B like ?',{},'aaa%');

$rc should hold the number of records affected by the update but always
holds 0E0 which is a real pain when trying to do
update || insert (as part of a performance oriented data import/merge)

To put it simply this limitation of DBD::ADO means that we have to
fix the problem or rewrite code with consequent performance
degredation. My preference is to fix the problem.

If nothing else DBD::ADO should be documented regarding this limitation
but only *if* the limitation is widespread. I was hoping other users
would state that they do not have this problem.

If anyone else uses DBD::ADO and has had (or does not have) similar symptoms
with DBD::ADO please feed me 
    perl -V  
    perl -MDBI=9999
    perl -MDBD::ADO=99999
    perl -MWin32::OLE=9999

We will collate feedback and use this to investigate the problem.

Thanks,
  Jacqui


Jacqui Caren, Ingram Group Ltd. [EMAIL PROTECTED]
ph: +44 (0) 1483 8628xx main=00 fax=01 ddi=65
http://www.ig.co.uk/ http://www.sitedirector.org/
http://www.perl.co.uk/


Reply via email to