On Thu, 21 Apr 2005 09:36:33 -0400, Robert wrote:

>This is my hash structure:
>
>"Veterans Day" => {
>    date    => '20051111',
>    type    => 'US',
>    federal => 'true',
>    active  => 'true',
> },
>
>Would I just use a placeholder (?) in my statement and pass it in via that? 

Use DBIx::Simple, it becomes a  one-liner. Well, almost: you don't have
an entry for the holiday name.

        $db->insert('mytable', {
            name => $key,
            date    => '20051111',
            type    => 'US',
            federal => 'true',
            active  => 'true',
         });

DBIx::Simple takes all the manual work out of your hand, prepares the
statement, exectutes it (with placeholders)... and keeps a cache of
prepared statements, so it's virtually as efficient as if you had built
it by hand.

-- 
        Bart.

Reply via email to