Sorry for my English. I cannot express well my problem.

The thing is: I know how primary key works, but I don't understand the error
I am getting from sqlite3. I mean, If I tried to execute a query which is an
insert with an existing pk, is it ok to receive  BUSY or IOERR_BLOCKED ?
That is what I am getting. But I think this error has nothing to do with
duplicated pk. Shouldn't I get an SQLITE_ERROR or something like that ?

could I explain it well my problem now?

many thanks,

mariano


On Sun, Sep 28, 2008 at 9:15 PM, P Kishor <[EMAIL PROTECTED]> wrote:

> 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
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to