Hi,
I am trying to update records in a SQLite table that I link to in a Query Builder automatic query in Rev4.0 (described in the http://downloads.runrev.com/userguide/userguide.pdf PDF on pages 280 and onwards). I am able to view records and move between them.
1) the "Save options" (pg 285 point 8.5.3 in the PDF) are not available in the field properties, "database" page where I link the field to the Query. So I cannot edit the records. Any ideas?
2) How do I have a button to delete the current record and a second button to add a new record. I can do "Next", "Previous", "First" and "Last" but there is no entry for either "Delete" or "Add new". Again, any ideas of what I should pursue?
Thanks!
Use of Query Builder questions
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Location: Aalst, Belgium
- Contact:
Interesting, it seems that someone at RunRev HQ decided to not completely remove these, but moved them off-screen instead. Perhaps they have plans to revise the database linked control system, but this is odd, indeed. The underlying code to update the database is still there...BattleWofl wrote:1) the "Save options" (pg 285 point 8.5.3 in the PDF) are not available in the field properties, "database" page where I link the field to the Query. So I cannot edit the records. Any ideas?
While you can patch this, with a bit of patience, it's probably best to file this as a bug report in the Quality Control Center - that way, the team can either acknow<ledge that this is obsolete, or put it back in the next release.
This is a tricky topic, which comes back regularly. If your query is only fetching items from a single table, this is relatively straightforward:BattleWofl wrote:2) How do I have a button to delete the current record and a second button to add a new record. I can do "Next", "Previous", "First" and "Last" but there is no entry for either "Delete" or "Add new". Again, any ideas of what I should pursue?
- deleting a record could be done, if you entered the primary key in the query builder and any related records are automatically deleted in cascade at the database level
- creating a new record, however, is a different matter, as rev can't really determine how to fill in the fields that make up the primary key
- should it try and delete records from all the tables, and how can it determine the where clause for those related deletes?
- again, how should it create a new record, one for each table, and how should it fill in the primary and foreign keys
But you can script the necessary create and delete queries yourself: by using the revConnectionOfQuery("<query name>") function to get the underlying database connection, and then using this connection in calls to the revExecuteSql <connection id>, <sql query> command.
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Re: Use of Query Builder questions
I see that this issue was recorded in the Quality Control Centre (Report #8485) on 4th December. The issue was logged against software version 4.0.0 RC1 however I can confirm that this is also the case with version 4.0.0. Is there any feedback available? Alternatively should this be logged as a bug in the User Manual? Perhaps Jan could explain the patch in the meantime?Janschenkel wrote:Interesting, it seems that someone at RunRev HQ decided to not completely remove these, but moved them off-screen instead. Perhaps they have plans to revise the database linked control system, but this is odd, indeed. The underlying code to update the database is still there...
While you can patch this, with a bit of patience, it's probably best to file this as a bug report in the Quality Control Center - that way, the team can either acknow<ledge that this is obsolete, or put it back in the next release.
Thanks very much,
Martin