in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

CREATE TABLE query doesn't run with an AUTOINCREMENT column on the Query Designer

Last post 02-16-2007 9:34 PM by Fred_Pyo. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 02-13-2007 8:09 PM

    CREATE TABLE query doesn't run with an AUTOINCREMENT column on the Query Designer

    Hello again everybody!

    This time I'm having a little problem creating tables through MS Visual C# 2005 Express Edition's (MSVCS2005EE?) query designer, this is the query when I write it:

    CREATE TABLE materias(materia_id INTEGER PRIMARY KEY AUTOINCREMENT, codigo CHAR(6), nombre VARCHAR(15));

    When I hit the Run Query command, an SQL Execution error appears, saying that there's an error near "[AUTOINCREMENT]".

    When I close the error dialog, I see that my query has changed to (changes in red):

    CREATE TABLE materias(materia_id INTEGER PRIMARY KEY [AUTOINCREMENT], codigo CHAR(6), nombre VARCHAR(15));

    I am working around this using the command line tool when I can, or running the queries from a separate application, but I would like to know why those square brackets appear around AUTOINCREMENT.

    Thank you very much.
  • 02-13-2007 8:27 PM In reply to

    Re: CREATE TABLE query doesn't run with an AUTOINCREMENT column on the Query Designer

    Sorry for the... false alarm. After reading a little, I found out that if I write my query like this:

    CREATE TABLE materias(materia_id [INTEGER PRIMARY KEY AUTOINCREMENT], codigo CHAR(6), nombre VARCHAR(15));

    Everything runs smoothly.
  • 02-14-2007 3:00 PM In reply to

    Re: CREATE TABLE query doesn't run with an AUTOINCREMENT column on the Query Designer

    Well.. scratch that... the only thing that ends up happening is that I create a cell with the INTEGER PRIMARY KEY AUTOINCREMENT data type... that's not what I want ;).

    I read somewhere that AUTOINCREMENT isn't necessary (although I don't remember if I was reading about SQLite or another DBMS...), because PRIMARY KEY prevents duplicates from happening. But I still need the AUTOINCREMENT property.

    So, can anybody help me with this little ploblem?

  • 02-14-2007 3:26 PM In reply to

    Re: CREATE TABLE query doesn't run with an AUTOINCREMENT column on the Query Designer

    I'm going to be investigating this over the weekend.  If it's something fixable to do with the query editor, I'll have it fixed for the next release coming up.

    Robert

     

  • 02-15-2007 10:02 AM In reply to

    Re: CREATE TABLE query doesn't run with an AUTOINCREMENT column on the Query Designer

    Thank you very much!

    Say, by any chance is it possible for *us* (read: people with MSVS Express editions) to successfully edit and compile the source code of your SQLite wrapper?

    (Next release will include SQLite 3.1.13 :)? )
  • 02-15-2007 10:17 AM In reply to

    Re: CREATE TABLE query doesn't run with an AUTOINCREMENT column on the Query Designer

    I've never tried compiling on Express Editions.  You'd need C++ and C# at a minimum.

    And yes of course, the next version will have the latest SQLite 3.3.13 code.

    Robert

     

  • 02-16-2007 9:34 PM In reply to

    Re: CREATE TABLE query doesn't run with an AUTOINCREMENT column on the Query Designer

    Hi again Robert,
    First of all, let me tell you that my Express Editions are having a hard time trying to open the whole SQLite.NET solution file (some file associations are missing it says, maybe I have to have installed something more than C++ and C#). With C# if I remember correctly I had access to  System.Data.SQLite :).

    On other news, do you use SQLite release versions when building your SQLite.Net provider, or do you use latest CVS stuff? Because I'm quite worried about this bug (2236) that makes INSERT queries with SELECTS not to work. It is fixed now, but it's not in 3.1.13.

    I'll keep on looking into your code, maybe I can find a way to create a partial build or something :). I'm not very familiar with Solutions yet, so I will take a while. I'm just learning my way through. I really love this project!

    Thank you very much again!
Page 1 of 1 (7 items)
Powered by Community Server (Commercial Edition), by Telligent Systems