I'm trying to manipulate an internal database with the following code:
sql = "CREATE TABLE IF NOT EXISTS tipo ([codigo] integer autoincrement,nome text not null);";
bancoDados.execSQL(sql);
sql = "INSERT INTO \"tipo\" VALUES(1,\"ESTADUAL\");";
bancoDados.execSQL(sql);
sql = "INSERT INTO \"tipo\" VALUES(2,\"MUNICIPAL\");";
bancoDados.execSQL(sql);
sql = "INSERT INTO \"tipo\" VALUES(3,\"PRIVADA\");";
bancoDados.execSQL(sql);
sql = "INSERT INTO \"tipo\" VALUES(4,\"FEDERAL\");";
The error I'm having is the following:
03-23 20:22:26.419: E/Database(368):
Failure 19 (PRIMARY KEY must be unique) on 0x92ba0 when executing
'INSERT INTO "tipo" VALUES(1,"ESTADUAL");'
I've already tried a few things: to get the number that I was inserting myself (by being with an autoincrement) but did not give and continued the same error ... Does anyone know what's wrong?