Re: How to insert 'empty' or 'default' values when SQL is first prepared and then executed



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



Relevant Pages

  • for newbies and HTDP - 2
    ... you more productive by chnaging you from SYNTAX oriented to PROGRAMMING ... FIRST please have look at the EXERCISE STATEMENT in the book, ... one natural-recursion is happening WITHIN the selector ... lotp) empty] ...
    (comp.lang.scheme)
  • for newbies and HTDP - 2
    ... you more productive by chnaging you from SYNTAX oriented to PROGRAMMING ... FIRST please have look at the EXERCISE STATEMENT in the book, ... one natural-recursion is happening WITHIN the selector ... lotp) empty] ...
    (comp.lang.scheme)
  • for newbies HTDP
    ... My purpose is NOT PROVIDING solutions to exercises in the book (they ... DESIGN-PROCESS (I am sorry there is no BEST way to debug a programme as ... you more productive by chnaging you from SYNTAX oriented to PROGRAMMING ... a-lon) empty] ...
    (comp.lang.scheme)
  • Re: Programing Help Needed!
    ... Ed - if you are uncomfortable with programming, ... change it into an append query to append it to the second table. ... Access will create multiple records for each of the ... in an Access 2000 database. ...
    (microsoft.public.access.modulesdaovba)
  • Re: How to compare 2 elements with same getElementById(x)?
    ... prototype. ... javascript object is never 'empty'. ... operator in a general programming context; ...
    (comp.lang.javascript)