AUTOINCREMENT is only available on INTEGER PRIMARY KEY columns: http://sqlite.org/lang_createtable.html http://sqlite.org/autoinc.html
On Wed, Feb 23, 2011 at 9:15 AM, Abhilash baddam <[email protected]> wrote: > Hi, > I am trying to create a table, like this > > myDB.execSQL("CREATE TABLE IF NOT EXISTS bikes_list(_id INTEGER > AUTOINCREMENT, name PRIMARY KEY VARCHAR , availablebikes INT, slots > INT,status VARCHAR);"); > but i am getting this Exception, > ERROR/AndroidRuntime(11141): > Caused by: android.database.sqlite.SQLiteException: near "AUTOINCREMENT": > syntax error: CREATE TABLE IF NOT EXISTS bikes_list(_id INTEGER > AUTOINCREMENT, name PRIMARY KEY VARCHAR , availablebikes INT, slots > INT,status VARCHAR); > > > what may be the reason..? > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android App Developer Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

