I'm only familiar with the "build the SQL" method, but if there's an
alternate method it would be described in the excellent DBI perldocs,
which you can access by doing

    perldoc DBI

at a command prompt.

HTH.

Hardy Merrill

>>> "Chris Faust" <[EMAIL PROTECTED]> 03/12/04 09:33AM >>>
Good Morning,

Please forgive if this is considered off topic, I thought it would be
the best place to start.

I think I have a very simple question, I have a perl hash in which all
the keys are my tables field names and the values are the values that I
wish to insert into my table.

Is there is a simple way using DBI that I can just pass the hash off
for a insert or is the only way to do it is to first foreach over the
hash and construct the SQL statement and then when finished, execute
it..

I guess I'm wondering if there is any kind of magic where I could say
something like

$sth = $db->prepare("Insert into table")
$sth->execute(%hash_where_keys_are_fieldnames_and_values_are_the_insert_values);

Thanks
-Chris

Reply via email to