autoinc and SQLite Personal1.7.19

Discussion in 'Questions (Windows Mobile)' started by Ricky D, Sep 13, 2008.

  1. Ricky D

    Ricky D Well-Known Member Licensed User

    I have downloaded the free personal version of SQLite Expert.

    I have created a field as autoinc in a table.

    I find that when I do an insert into the table from Basic4PPC the autoinc field doesn't automatically create an entry in the field.

    I am also trying SQLMaestro and I can edit the field and make it do autoincrement so that it does add data in the field.

    Has anyone experienced this?

    regards, Ricky
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I guess that the autoinc field is not a real SQLite INTEGER PRIMARY KEY AUTOINCREMENT field but rather a marking that is used by SQLite Expert.
    You can add an auto increment field when you create the table:
    Code:
    CREATE TABLE table1 (col1 INTEGER PRIMARY KEY AUTOINCREMENT, col2)
    See these pages for more information: SQLite Query Language: CREATE TABLE
    SQLite Autoincrement
     
  3. Ricky D

    Ricky D Well-Known Member Licensed User

    I figured it out

    Hi Erel.

    I got it working by :

    Creating an Integer field

    Creating an Index on this field and making it Primary - the Autoincrement checkbox becomes enabled so click it.

    I tested it and it works like a charm.

    regards, Ricky
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice