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

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -