I'm in the middle of porting a DBIx::Class based application to the firebird database, and thus DBD::InterBase.

On insert statements I get the error message

Can't locate DBI object method "last_insert_rowid" via package "DBD::I +nterBase::db" at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1275 +.

which means that DBD::InterBase doesn't seem to support the last_insert_id method as DBIx::Class expects.

Ironically during the build process a file InterBase.xsi is generated, which contains such a method:

#ifdef dbd_db_last_insert_id void last_insert_id(dbh, catalog, schema, table, field, attr=Nullsv) SV * dbh SV * catalog SV * schema SV * table SV * field SV * attr CODE: { D_imp_dbh(dbh); ST(0) = dbd_db_last_insert_id(dbh, imp_dbh, catalog, schema, table +, field, attr); } #endif

So there seems to be support for last_insert_id, but it's not enabled. How can I enable it? If I simply remove the #ifdef and #endif lines from that file, I get this message many times during make test:

install_driver(InterBase) failed: Can't load '/home/moritz/tmp/DBD-Int +erBase-0.48/blib/arch/auto/DBD/InterBase/InterBase.so' for module DBD +::InterBase: /home/moritz/tmp/DBD-InterBase-0.48/blib/arch/auto/DBD/I +nterBase/InterBase.so: undefined symbol: dbd_db_last_insert_id at /us +r/lib/perl/5.10/DynaLoader.pm line 196.

Or is there any other simple way to get DBIx::Class + DBD::InterBase working, without digging deep into both and writing a DBIx::Class::Storage::DBI::Interbase module or so?


In reply to Building DBD::InterBase with last_insert_id by moritz

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.