Hello, Jacqui.

I use DBD::ADO 2.5 with $dbh->execute() and have no problem to get number of
rows affected.
But $dbh->do() returns me -1 always.

perl -V :
Summary of my perl5 (revision 5 version 6 subversion 1) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef use5005threads=undef useithreads=define
usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cl', ccflags ='-nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT
-DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -D
L_IMPLICIT_SYS -DPERL_MSVCRT_READFIX',
    optimize='-O1 -MD -DNDEBUG',
    cppflags='-DWIN32'
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=4
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='', ldflags ='-nologo -nodefaultlib -release
-libpath:"C:\Perl\lib\CORE"  -machine:x86'
    libpth="C:\Program Files\SQLLIB\LIB" "C:\Program Files\Mts\Lib"
"C:\Perl\lib\CORE"
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib olea
2.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib
odbc32.lib odbccp32.lib msvcrt.lib
    perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib
aut32.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib
odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release
-libpath:"C:\Perl\lib\CORE"  -machine:x86'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS PERL_IMPLICIT_CONTEXT
PERL_IMPLICIT_SYS
  Locally applied patches:
        ActivePerl Build 626
  Built under MSWin32
  Compiled at May  2 2001 01:31:15
  %ENV:
    PERL="PERL"
    PERLDB_OPTS="RemotePort=127.0.0.1:2000"
  @INC:
    C:/Perl/lib
    C:/Perl/site/lib
    .

perl -MDBI=9999
DBI 9999 required--this is only version 1.21 (C:/Perl/site/lib/DBI.pm) at - line

0

perl -MDBD::ADO=99999
This is hang, but I know that the version is 2.5

perl -MWin32::OLE=9999
Win32::OLE 9999 required--this is only version 0.1502
(C:/Perl/site/lib/Win32/OLE.pm) at - line 0

Cheers,
Vassiliy


Jacqui Caren wrote:

> 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