Hi, people!

I've scanned through the FAQ and various other materials but I can't see
anything answering my question, so I thought I'd ask the gurus here.

I'm wanting to do a lot of inserts into a database, and some of the
fields contain nulls.  I'm inserting this data from a hash whose keys
are the column names in the database.  Obeying the principle of database
change survival, I get the column information from the database and
build up an insert statement from that that inserts the right fields in
the right columns.  The most efficient way for me to do the inserts is
to use placeholders, right?  However, when I try to insert a null on a
placeholder DBI complains that it can't use nulls on an untyped field.

The twin prongs of my question are: OT1H is there any way to supply DBI
with the types of each field without supplying a scalar ref to bind the
column to in bind_param_inout()?  OTOH, can I bind each column using
bind_param($col_no,$hash{$column_name},$column_type($column_name))? 
Will this bind to the (changing) values in the hash, or will, as it
seems to indicate in the documentation I have, that the _value_ of
whatever's in $hash{$column_name} at the time is what will be bound by
bind_param()?

Thanks muchly in advance,

Paul

-- 
>>Paul Wayper is a Systems Engineer at Lochard Pty. Ltd.<<
>>Phone: + 61 3 9508 4930          Fax: + 61 3 9500 1197<<
_.__.____.______.__________.____________.________________.
-- 
This email and any attachment(s) is intended only for the use of the
intended recipient(s) and may contain information that is confidential and
privileged. If you are not the intended recipient(s), you are hereby
notified that any dissemination, distribution or copying of this email is
strictly prohibited and may be unlawful. If you have received this email in
error, please notify the sender immediately by return email, 
and destroy the original message together with any copies made of it, 
electronic or printed.



Message protected by MailGuard: e-mail anti-virus and content filtering.
http://www.mailguard.com.au/mg


Reply via email to