On Tue, May 20, 2008 at 11:33:04AM -0700, Jeff Hamilton scratched on the wall:
> Hi all,
> 
> I have a table like this
> 
> CREATE TABLE foo (bar TEXT NOT NULL DEFAULT 'default_value');
> 
> and I'd like to create a reusable statement to do inserts into foo, like this:
> 
> INSERT INTO foo (bar) VALUES (?);
> 
> Sometimes I have values for bar and sometimes I don't and want the
> default. Is there any way to indicate to the statement that I want the
> bound parameter to be "nothing" therefore giving me the default value?
> If I bind that column to NULL I get a constraint error.

  sqlite3_clear_bindings() resets all of the bindings.

  http://www.sqlite.org/c3ref/clear_bindings.html


   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"'People who live in bamboo houses should not throw pandas.' Jesus said that."
   - "The Ninja", www.AskANinja.com, "Special Delivery 10: Pop!Tech 2006"
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to