0

Here is my current SQLite table:

CREATE TABLE formula (_id INTEGER PRIMARY KEY AUTOINCREMENT,suggest_text_1 TEXT,formula TEXT,category TEXT);

I want to integrate search suggestions in an Android app, but I need a SUGGEST_COLUMN_INTENT_DATA_ID and I want my _id to represent it. But I also need a _id for the content provider. So is there a way where I could have SUGGEST_COLUMN_INTENT_DATA_ID and store the current and future values of _id in it? Would I use an alias?

Mohit Deshpande
  • 53,877
  • 76
  • 193
  • 251

1 Answers1

1

Would I use an alias?

This is possible but it depends on your exact requirements. See my answer to this question to see if this applies to you. Android: column '_id' does not exist problem

Community
  • 1
  • 1
Squonk
  • 48,735
  • 19
  • 103
  • 135
  • So basically what I want to do is to implement search suggestions in my application and I need the SUGGEST_COLUMN_INTENT_ID so that I can call getData() on my search activity intent (android.intent.action.view). So I need that column in the database, and I want it to have the same values as _id. So how can I achieve that? – Mohit Deshpande May 07 '11 at 02:51
  • Yes use an alias. Something along the lines of `"SELECT _id AS " + SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID + " FROM table"` – Joseph Earl May 07 '11 at 03:55