The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Insert Or Ignore In SQLite

TODO: Pull subtitle into page object
Code
CREATE TABLE example_table(example_item TEXT UNIQUE);

Then do this:

Code
INSERT OR IGNORE 
INTO example_table(example_item) 
VALUES("alfa bravo");

Note that with this approach an AUTOINCREMENT counter increases even if a row isn't inserted. If that bugs you, you can either not use AUTOINCREMENT (e.g. use the generic ROWID) or use a different approach.

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Insert Or Ignore In SQLite

-- code
-- sql

CREATE TABLE example_table(example_item TEXT UNIQUE);

-- p

Then do this:

-- code
-- sql

INSERT OR IGNORE 
INTO example_table(example_item) 
VALUES("alfa bravo");

-- p
 
Note that with this approach an AUTOINCREMENT counter 
increases even if a row isn't inserted. If that bugs you, you 
can either not use AUTOINCREMENT (e.g. use the generic ROWID) 
or use a different approach.


-- ref
-- url: https://www.sqlite.org/lang_createtable.html
-- title: SQLite Create Table


-- categories
-- SQLite 

-- metadata
-- date: 2015-07-19 20:16:54
-- id: 019tmd42
-- status: published
-- type: post
-- site: aws