android - Search if a field exists in sql db -


i have db key_numero unique.first create new row want check if field have same key_numero.

public boolean playerexists(int inputtext) throws sqlexception {       cursor mcursor = null;        mcursor = mdb.query(true, sqlite_table, new string[] {key_rowid, key_numero, key_nome, key_cognome, key_ruolo},key_numero+"="+inputtext, null, null, null, null, null);       boolean result=mcursor.movetofirst();       return result;      } 

why return true??

because don't data db. should check mcursor.getint(0) there key_rowid of current possition of cursor.

but why did not use autoincrement db?


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -