I am having difficulty deleting rows in DBD::AnyData.
Below is a sample that does not work for me. The return from the do() says 4 rows, but then the count(*) says there are still 4 rows in the table.

Thanks for any information

installation specs:

Linux myserver 2.6.26-2-686 #1 SMP Wed May 12 21:56:10 UTC 2010 i686 GNU/Linux
This is perl, v5.10.0 built for i486-linux-gnu-thread-multi
Module id = DBD::AnyData
DESCRIPTION DBI access to XML, CSV and other formats
CPAN_USERID JZUCKER (Jeff Zucker <jeff@vpservices.com>)
CPAN_VERSION 0.110


use strict; use DBI; my($sql, $sth); my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):'); $dbh->{TraceLevel} = 1; $dbh->func( 'obs', 'CSV', [<DATA>], 'ad_import'); $sql = "delete from obs"; my $ret = $dbh->do($sql); print "ret: $ret\n"; $sql = "select count(*) from obs"; $sth = $dbh->prepare($sql); $sth->execute(); my $count = $sth->fetchrow_array(); $sth->finish(); print "$count rows in obs after delete\n"; __DATA__ "obs_id","flow_nm","event_type_nm","event_subtype_nm","event_selected" 1,nw,flow_nw_pyro,pyro_1_less,0 2,nw,flow_nw_pyro,pyro_1_2,0 3,nw,flow_nw_pyro,pyro_2_3,0 4,nw,flow_nw_pyro,pyro_3_more,1

In reply to DBD::AnyData delete rows by Perly Eyed

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.