How to insert 'empty' or 'default' values when SQL is first prepared and then executed
- From: PPeng@xxxxxxxxxxx (Pai Peng)
- Date: Tue, 26 Sep 2006 12:51:35 -0700
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. I know I
probably can set '0' for numerical columns and 'space' for varchar
columns. But is there a simpler way so I don't need to worry about data
types?
Thanks,
Pai
- Follow-Ups:
- Re: How to insert 'empty' or 'default' values when SQL is first prepared and then executed
- From: Peter J. Holzer
- Re: How to insert 'empty' or 'default' values when SQL is first prepared and then executed
- From: Alexander Foken
- Re: How to insert 'empty' or 'default' values when SQL is first prepared and then executed
- Prev by Date: Warning on 64-bit Linux building DBD::Oracle
- Next by Date: DBI beginner question...
- Previous by thread: Warning on 64-bit Linux building DBD::Oracle
- Next by thread: Re: How to insert 'empty' or 'default' values when SQL is first prepared and then executed
- Index(es):