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

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

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