On 25 October 2014 14:49, Stephen Chrzanowski <pontia...@gmail.com> wrote:
> I've got a table that has defaults set for all fields
>
> CREATE TABLE [tEvents] (
>   [EventID] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
>   [Airline] CHAR DEFAULT '',
>   [TicketID] INTEGER DEFAULT 0,
>   [Resolved] BOOL DEFAULT 0);
>
>
> Seems to me it'd be a bit redundant to do an "insert into tEvents
> (TicketID) values (0)" when the default is already set (And who says I may
> not want to change the default later to -1 for whatever reason?).
>
> The question is, how would I insert a blank row and rely on the defaults
> I've got in the schema?  "insert into tEvents () values ()" fails, as does
> removing the first pair of brackets, as well as removing all brackets.

INSERT INTO tEvents( EventId ) VALUES( null );

Regards,
Simon
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to