"Country" was only example, there are much other "dictionary" tables. I finally solved this by second command which first check if record exists. I asked this question because I thought that maybe there is some "magic" trick to do this in one command ;) For example PostgreSQL has INSERT command which has also RETURNING clause which return any of inserted column (but what I remember PostgreSQL doesn't have OR IGNORE clause, so same problem :P ) . Anyway problem solved
BTW: About storing dictionary tables in memory. What is faster: - Load all "contries" table to memory and locate it locally (I'm using Free Pascal / Lazarus) - Create unique index on country name and select from countries table on each insert to customers What consume more time if table has 100-200 record, sequence locate in memory or firing index search? _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users