Re: How to insert 'empty' or 'default' values when SQL is first prepared and then executed
- From: hjp@xxxxxxxxx (Peter J. Holzer)
- Date: Wed, 27 Sep 2006 12:04:32 +0200
On 2006-09-26 12:51:35 -0700, Pai Peng wrote:
In my project I first prepare an INSERT statement 'INSERT INTO table
(col1, col2, col3, ...) VALUES (?, ?, ?, ...)' once, then insert
multiple records using 'execute(@values)'. The problem is that not all
values of all columns are available. So I should either leave them empty
or set them as default values. I try to use 'NULL' or 'DEFAULT' for
those unavailable values in '@values', but it didn't work.
That would insert the literal string 'NULL' or 'DEFAULT'. To insert a
null value, use undef.
hp
--
_ | Peter J. Holzer | If I wanted to be "academically correct",
|_|_) | Sysadmin WSR | I'd be programming in Java.
| | | hjp@xxxxxxxxx | I don't, and I'm not.
__/ | http://www.hjp.at/ | -- Jesse Erlbaum on dbi-users
Attachment:
pgp2jO80mABSZ.pgp
Description: PGP signature
- References:
- Prev by Date: Re: How to insert 'empty' or 'default' values when SQL is first prepared and then executed
- Next by Date: Oracle Troubleshooter HOWTO on my homepage
- Previous by thread: Re: How to insert 'empty' or 'default' values when SQL is first prepared and then executed
- Next by thread: DBI beginner question...
- Index(es):
Relevant Pages
|
|