It's just you ;) (just kidding, it looks like a documentation bug at the very least.)

Change the name of your table from 'import' to 'mytable', and it works.

It isn't documented, but using 'import' as the table name causes SQL::Statement to try to call SQL::Statement::Functions::SQL_FUNCTION_IMPORT() with the wrong parameters - it expects a statement handle, which it doesn't get. Using the debugger, I verified that SQL_FUNCTION_IMPORT is not called wrongly when the table is named differently.

Here's an example using ad_catalog (I get the same results with ad_import):

#!/usr/bin/perl use warnings; use strict; # to prevent silly errors use DBI; my $addbh = DBI->connect('dbi:AnyData(RaiseError => 1):'); $addbh->func('mytable', 'CSV', [ <DATA> ], 'ad_catalog'); my $sth = $addbh->prepare( 'select foo, bar, baz from mytable' ); $sth->execute; DBI::dump_results($sth); #$sth->finish; #$addbh->disconnect; __DATA__ foo,bar,baz 1,2,3 4,5,6 7,8,9
Results:
$ perl anydata.pl '1', '2', '3' '4', '5', '6' '7', '8', '9' 3 rows DBI handle 0x85cecf8 cleared whilst still active, <DATA> line 4. dbih_clearcom (sth 0x85cecf8, com 0x85d1c58, imp DBD::AnyData::st) +: FLAGS 0x182195: COMSET Active Warn RaiseError PrintError PrintW +arn ShowErrorStatement PARENT DBI::db=HASH(0x85cebfc) KIDS 0 (0 Active) IMP_DATA undef NUM_OF_FIELDS 3 NUM_OF_PARAMS 0
I can't seem to suppress or fix the "DBI handle cleared whilst still active" message

Hopefully, jZed can shed more light when he gets a chance.

Update: I am using Debian unstable, all packages up-to-date


In reply to Re: DBD::AnyData completely broken (or is it just me?) by bmann
in thread DBD::AnyData completely broken (or is it just me?) by avarus

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.