How to put the values of a db column in an array?

Asked

Viewed 38 times

0

I have a table, which is written below. Busy is the part I will move. The value of Busy will be changing according to the program from 0 to 1, depending on whether you are busy or not. I need to load this values into an array, how can I do this ?

String QUERY_COLUNA = "CREATE TABLE " + TABELA_SLOT + "(" +
    COLUNA_CODIGO + " INTEGER PRIMARY KEY ," +
    COLUNA_BUSY + " INTEGER )";

db.execSQL(QUERY_COLUNA);

db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
db.execSQL("INSERT INTO " + TABELA_SLOT + "(BUSY) VALUES ('0')");
  • It would be interesting to put in your question what you have already done. This will make it easier for those who will answer.

  • I don’t understand your question! You want to query the value of the database and insert into an Array?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.