Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 27th, 2012  |  syntax: None  |  size: 0.74 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. SQlite - Android - Foreign key syntax
  2. private static final String TASK_TABLE_CREATE = "create table "
  3.             + TASK_TABLE + " (" + TASK_ID
  4.             + " integer primary key autoincrement, " + TASK_TITLE
  5.             + " text not null, " + TASK_NOTES + " text not null, "
  6.     + TASK_DATE_TIME + " text not null, FOREIGN KEY ("+TASK_CAT+") REFERENCES "+CAT_TABLE+" ("+CAT_ID+"));";
  7.        
  8. private static final String TASK_TABLE_CREATE = "create table "
  9.         + TASK_TABLE + " (" + TASK_ID
  10.         + " integer primary key autoincrement, " + TASK_TITLE
  11.         + " text not null, " + TASK_NOTES + " text not null, "
  12. + TASK_DATE_TIME + " text not null,"
  13. + TASK_CAT + " integer,"
  14. + " FOREIGN KEY ("+TASK_CAT+") REFERENCES "+CAT_TABLE+" ("+CAT_ID+"));";