facebook

Need Example of Storing selection from a list in SQLite

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #335951 Reply

    Pauldivaniii
    Member

    I have a multi-selection list in my iPhone application and when the user leaves the page it is one I want to save the selections to the database. I also need to remove any previous selections that have been unselected. Is there an example of using the db.transaction method to group a set of calls together to test if a row exists and then delete it if it is no longer selected or insert it if it does not? Something like the pseudocode below:

    tx.executeSql(“if {[db exists {SELECT value1 FROM table1 WHERE key=’key1′}]} {” +
    ” DELETE FROM table1 where key=’key1′}”);
    tx.executeSql(“if {[db not exists {SELECT value1 FROM table1 WHERE key=’key1′}]} {” +
    ” INSERT INTO table1 (key,value) VALUES(?,?)}”,[“key1″,”value1”],successfulTx, errorTx);

    I am extremely good at transact SQL but I do not know what the limits of the tx.executeSql command string is and can’t find any detailed examples.

    #336005

    Hi Pauldivaniii,

    I’ve escalated this question to our dev team to give you the best advice. Will follow up as soon as I get more info.

    #336484

    Pauldivaniii
    Member

    Octavo:

    Any additional information on this? I would even be happy with some samples javascript that show me how to loop through all the items and determine if an item in a multi-select list is selected and another example the shows how to mark an item in a list as selected. I am for whatever reason having trouble working these two out.

    Thanks

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Need Example of Storing selection from a list in SQLite

You must be logged in to post in the forum log in