On 9/28/08, Mariano Martinez Peck <[EMAIL PROTECTED]> wrote:
> Please I need help with this :(
>
>   I am getting BUSY or IOERR_BLOCKED when inserting a duplicated pk through C
>  interface.
>
>  If I do it through sqlite.exe I get: SQL error: PRIMARY KEY must be unique
>
>  Any ideas?

Yes. The PRIMARY KEY must be unique. In other words, it should not be
a duplicate of one that already exists. That is the whole idea behind
a PRIMARY KEY. Which part of that is causing confusion?

>
>  many thanks,
>
>
>  mariano
>
>
>
>
>  On Sun, Sep 21, 2008 at 9:05 PM, Mariano Martinez Peck <
>  [EMAIL PROTECTED]> wrote:
>
>  > Hi everybody!
>  >
>  > This is my first post in this list! I am very newbie with Sqlite. This is
>  > the first time I am trying to use it. I am using Sqlite3 trough C 
> interface.
>  > The problem I have is this: I have a table created, just like this:
>  >
>  > CREATE TABLE materia(
>  >     codigo INTEGER PRIMARY KEY,
>  >     nombre CHARACTER VARYING(50),
>  >     observaciones CHARACTER VARYING(255),
>  > )
>  >
>  > Then I do 2 inserts one after the other, with the same data. For example:
>  >
>  > INSERT INTO materia(codigo, nombre, observaciones) VALUES (55, ''TADP'',
>  > ''Nothing")
>  >
>  > After doing this, I thought the second query ( i am using sqlite3_step()
>  > function ) will returns me a 
> SQLITE_ERROR<http://www.sqlite.org/c3ref/c_abort.html>.
>  > However, it SQLITE_IOERR_BLOCKED.
>  >
>  > Is this correct? what should sqlite3_step returns me in this case?
>  >
>  > Many thanks for the help,
>  >
>  > Mariano
>  > .
>  >
>  >
>  _______________________________________________
>  sqlite-users mailing list
>  sqlite-users@sqlite.org
>  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to