Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: MySQL INSERT in Perl

by happy.barney (Friar)
on Aug 04, 2011 at 12:13 UTC ( [id://918511]=note: print w/replies, xml ) Need Help??


in reply to Re: MySQL INSERT in Perl
in thread MySQL INSERT in Perl

use SQL::Abstract; my $SQL = SQL::Abstract->new; ... my ($sql, @bind) = $SQL->insert ($table, \%h1); $dbh->do ($sql, {}, @bind);

Replies are listed 'Best First'.
Re^3: MySQL INSERT in Perl
by baperl (Sexton) on Aug 04, 2011 at 15:00 UTC
    thx superdoc, I'm not sure I fully understand how that will work... also, it seems like I should replace prepare/execute with do()?

      SQL::Abstract generates (simple) sql statement from perl data structures.

      Yes, you can replace prepare/execute everywhere you don't care about returned rows or rows are not returned, like insert/update/delete without returning clause. See DBI#do

        sounds good...thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://918511]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2025-07-09 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.