sql - Android AUTOINCREMENT column besides PRIMARY KEY column -


i have table varchar column primary key. furthermore want have autoincremented id each row. column id called "id" not "_id". when try create database, error have syntax error near "autonincrement".

 public static final string sql_create_entries =          "create table " + contactentry.table_name + " (" +          contactentry.column_name_entry_username + " varchar(20) primary key," +          contactentry.column_name_entry_id + " integer autoincrement," +          contactentry.column_name_entry_display_name +           " varchar(25))"; 

please note following : 1. using string primary key not idea in general, since strings not natural cluster indices. 2. autoincemrent possible integer primary key omitted in case


Comments

Popular posts from this blog

Change the color of an oval at click in Java AWT -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -