Creating Views

Quote from kevync on 2022-11-07, 11:15 amHello
I have a question about creating some "permanent views".
My purpose is that I will query them from a copy of my database. My questions is basically if they are dynamic ...meaning the results will updated when that view is accessed. So for example (see SQL below) -- I didn't want to assume that Sqlite works the way I have used MySql
CREATE VIEW myview
AS
SELECT PersonID, Sex, Living, Surname, Given, BirthYear, DeathYear
FROM PersonTable
LEFT JOIN NameTable ON (PersonID = OwnerID)
WHERE IsPrimary =1
Hello
I have a question about creating some "permanent views".
My purpose is that I will query them from a copy of my database. My questions is basically if they are dynamic ...meaning the results will updated when that view is accessed. So for example (see SQL below) -- I didn't want to assume that Sqlite works the way I have used MySql
CREATE VIEW myview
AS
SELECT PersonID, Sex, Living, Surname, Given, BirthYear, DeathYear
FROM PersonTable
LEFT JOIN NameTable ON (PersonID = OwnerID)
WHERE IsPrimary =1

Quote from kevync on 2022-11-07, 11:24 amAlso, are they any issues with having many "permanent" views within the RM database? (other than if/when RM was to change the database structure -- which I imagine is not likely).
Kevin
Also, are they any issues with having many "permanent" views within the RM database? (other than if/when RM was to change the database structure -- which I imagine is not likely).
Kevin

Quote from Tom Holden on 2022-11-07, 11:28 amViews are stored queries, not stored results. So, every time you open a view or select something from it, it is on the current data.
The only issues with storing Views in the RM database are:
- They don't travel with GEDCOM or drag'n'drop
- They probably would not travel with an upgrade that modifies the data structure.
- You would not want to submit your database to RM Support - they will decline to do anything.
Views are stored queries, not stored results. So, every time you open a view or select something from it, it is on the current data.
The only issues with storing Views in the RM database are:
- They don't travel with GEDCOM or drag'n'drop
- They probably would not travel with an upgrade that modifies the data structure.
- You would not want to submit your database to RM Support - they will decline to do anything.

Quote from kevync on 2022-11-07, 11:43 amPerfect - all expected except #3 which I can understand why from their perspective. I mainly wanted to make sure they were "stored queries" vs. "stored results". Most of them should be items that are not likely to change it 8.version but of course you never know. Thanks for your quick answer Tom. Kevin
Perfect - all expected except #3 which I can understand why from their perspective. I mainly wanted to make sure they were "stored queries" vs. "stored results". Most of them should be items that are not likely to change it 8.version but of course you never know. Thanks for your quick answer Tom. Kevin