Removing media from one person

I attached the 1920 Census to the people displayed in the window below:
Pic 1.jpg
I want to remove the media from Sophia only.and leave the media attached to the remaining people.

Actual Results:
I have Sophia’s record open, selected the media column for the fact, highlighted Sophia and pressed the Remove media button. It removes the media from everyone in the list. I have to re-add the media to everyone again. That is not good. That is a lot of wasted time.

Expected Results:
I expected to highlight the person I wanted to remove the media from. Select Remove media and the media only would be removed from only the person selected. I would expect the event to still be there. If I wanted to have the media removed from everyone, I would highlight/select everyone and then press remove media.

If the actual results is the way it is supposed to work, may I suggest an enhancement for the expected results?

Discussions & comments from Wikispaces site


ve3meo

Removing a media item from a specific person/event…

ve3meo
19 October 2017 04:12:54

Use Delete tag for what you wanted to have happen. The controls across the top are for the Media file or Album – Remove Media removes the media item from the Media Gallery and eliminates all its tags, as you discovered.

For RM user issues or questions having nothing to do with SQLite, please post to the RM Forum or FB Page.

Tom

Where is the data stashed

Pic 1.jpg
Pic 1
The explanation for the Details field in the EventTable of the Data Definitions states Content of Description field in Edit Person fact/event pane.
Pic 2.jpg
Pic 2
I take that to mean it should contain Marital Status: MarriedRelation to Head of House: Head in the above print screen.

I created the following query to get those details:

select et.eventid, et.eventtype, ft.Name, et.placeid, pt.name, substr(et.date,4,4), pt.name, et.Details, et.note

from eventtable et,
facttypetable ft,
placetable pt

where et.eventtype = ft.facttypeid
and et.placeid = pt.placeid
and ownerid = 70
;
I got the following results:
Pic 3.jpg
Pic 3

What file(s) do I find the Place details (address, Hospital, cemetery, etc.) field and the Descriptions: field on the Edit Person window above? I am trying to find where testing and Marital Status: MarriedRelation to Head of House: Head is stashed.

Discussions & comments from Wikispaces site


thejerrybryan

Place Details Location

thejerrybryan
18 October 2017 00:43:43

The Place Details are in the PlaceTable. The format is the same as for the Place info itself except that the PlaceType is 2 for PlaceDetails. The corresponding PlaceID is in the MasterID field. The basic idea is that you have to do a JOIN of the PlaceTable to itself so that you are joining the PlaceDetails values to the Place values on MasterID for the PlaceDetails and PlaceID for the Place.


ve3meo

ve3meo
18 October 2017 02:31:01

The text you are looking for is in the Blob type field Details. You need to convert the binary data to Text. See the different results between:
SELECT Details FROM EventTable;
and
SELECT TRIM(Details) FROM EventTable;

Tom


thejerrybryan

Descriptions field location

thejerrybryan
18 October 2017 00:46:59

This field has many names in RM, like all the multiple names for one person in a Russian novel. It is Description in the Edit Person screen, Details in the EventTable if you are using SQLite, and Value if you are in the Find/Search dialog in the RM user interface.


thejerrybryan

Individual Facts and Family Facts

thejerrybryan
18 October 2017 00:55:18

Your query for info about person 70 looks like it’s fine for individual events such as birth and death, but it will not work correctly for “family” event such as marriage. RM’s “family” events are really just for the couple, not for the children.

When you are first starting out with SQLite and RM, it’s probably easier to make two separate queries, one for individual events and one for couple events. The trick in the EventTable is to test the OwnerType field with a WHERE clause such that OwnerType = 0 for individual events and OwnerType = 1 for couple events. Individual events are easy. For couple events, OwnerID points to the FamilyTable rather than to the PersonTable. So depending on what you are trying to accomplish with couple events, you will probably have to JOIN the EventTable to the FamilyTable and the FamilyTable to the PersonTable or the NameTable (or to both).

Alternate Names List

I created alternate names for wives so I can find the wife with her married name.
I put the given and maiden name in the given for the alternate name. I put her husband’s surname in surname. I use Married as Name Type, Mrs. As Prefix and the husbands given name with parenthesis around it as the suffix.

I am using the following query to get the alternate names: (See Pic 1)
Pic 1.jpg
It works great if there is only one alternate name. It is a problem if there is more than one alternate name for each husband as displayed in Pic 1.

Pic 2.jpg
This is the print screen of Rootsmagic. (See Pic 2)

Pic 3.jpg
If I do a data view of the nametable and do a custom on ownerid of 590, I get the following: (See Pic 3)

Pic 4.jpg
If I do a data view of the familytable and do a custom on ownerid of 590, I get the following: (See Pic 4)

Pic 5.jpg
How do I get the original query to display the correct husband with the wife like displayed below? (See Pic 5)

Pic 6.jpg
I copy all of the results of the query into a spreadsheet to verify there aren’t any typos in the alternate name. (See Pic 6)

Is it possible to create the query to get the results contained in the spreadsheet? (Column O and Column P)

How could I put a where statement in thee query to select only certain ownerid’s? I need to be able to hard code it and to be able to input the ownerid.

Discussions & comments from Wikispaces site


ve3meo

Add Married Name as Alternate

ve3meo
15 September 2017 16:15:15

Are you acquainted with this script? Names+-+Add+Married


ve3meo

ve3meo
15 September 2017 16:22:41

Okay, I understand that you have already manually created these Alternate Names and are looking for a way to detect errors. Is that your objective?

If we are to tinker wit your script, it would be helpful if you would post the script file or copy the script onto the page.

Submit Your Problem #requestforhelp

Problem Queries
Create a New Page for your problem by editing this page, inserting a link from the Editor menu which will permit you to insert the text for the hyperlink and name your new page. After saving this revised page, click on your new link to create and edit your new problem page. On your new page, describe the problem and insert a link (Use the ‘Insert Images or Files’ button of the Editor bar) to the .rmgc or .ged file holding the sample data you are querying; this will allow you to upload the file. Discussion can then proceed around your page which can be revised as progress is made. Once solved, then your working query may be added to the RM4 Queries page.

Discussions & comments from Wikispaces site


thejerrybryan

Page Number Field in Citations using Freeform Source Template

thejerrybryan
05 June 2011 17:56:23

Using the Freeform source template, citations include a field called Page Number. To see it, edit an individual, go to the Citation Manager sub-window, choose a citation, and edit the citation. The page number field is towards the bottom of the sub-window in the green area, and is just under where it says “source details”.

I have been trying to figure out where this field is stored so that I may run an SQLite query against it, but I can’t it. It almost has to be in the CitationTable, but the only possibility in the Citation Table is a column entitled “Fields”. It display in hex in SQLiteSpy. I have a test database with only 5 citations. The page number is different in the 5 citations, and the hex data for Fields as displayed by SQLiteSpy is the same for all 5 citations. So the data must be somewhere else, or else SQLiteSpy is not displaying the entire contents of the Fields column in the CitationTable.

Jerry Bryan


ve3meo

ve3meo
05 June 2011 19:51:22

Use CAST to convert the BLOB to TEXT:
SELECT CAST(Fields AS Text) FROM CitationTable;

You will see a result like this for a Free Form template:
<?xml version=”1.0″ encoding=”UTF-8″?>
<Root><Fields><Field><Name>Page</Name><Value>Email 2 June 2008</Value></Field></Fields></Root>

Tom


craigg43

Add fact for color coding

craigg43
24 January 2013 03:12:45

I have a system of color coding all persons in my data base. I also have defined a fact call _color which I would like to add to each person to reflect their current color coding. Once that is done, I can use color coding for other purposes and still would be able to revert to my color coding system.
So I would like to be able to take all people and add a _color fact reflecting their current color coding.


ve3meo

ve3meo
24 January 2013 03:32:48

Adding a _color fact to store a current color code is one approach and lends itself to RM’s Search Persons tool. Is there any reason to use this fact to restore the color-coding? That would require a complementary query.

A second approach that is actually easier to implement is to snapshot the color settings to a new table in the database. Not searchable within RM. Easy to restore the setting from the table with a complementary query.

Tom


JoyceAE

Listing of Ref No’s for Spouses & Parents

JoyceAE
21 January 2014 22:51:51

What I want is a list (report) of everyone in my database with the following information:

Person’s RefNo, Person’s Name, Spouse’s RefNo, Spouse’s Name, Father’s RefNo, Father’s Name, Mother’s RefNo & Mother’s Name

For example:

Person’s Spouse’s Father’s Mother’s
RefNo Name RefNo Name RefNo Name RefNo Name
H456 George Harris H717 Ed Harris L954 Edith Lister No spouse
J001 Joyce Smith M124 Fred Brown J002 Bill Smith G056 Mary Good Spouse, father & mother
M546 Harry Mead M856 Roy Mead Only a father
R563 Edith Royce W067 Angela Woodman Only a mother

If the person does not have a spouse then that information should be blank. The same thing goes for either of the person’s father or mother.

Can someone point me to an SQL query that might provide this kind of information? Right now, I am trying to maintain this information in an Excel spreadsheet but it is very labour-intensive and prone to errors and discrepancies. Any help on this would be greatly appreciated.


wegm

wegm
07 May 2015 20:25:34

This should do what you want:

— Listing of Ref No’s for Individuals and Spouses & Parents

SELECT
PersonTable.PersonID AS [PersonsRefNo],
CASE
WHEN ifnull(NameTable.Prefix, ”) = ”
THEN ”
ELSE NameTable.Prefix || ‘ ‘
END || CASE
WHEN ifnull(NameTable.Given, ”) = ”
THEN ”
ELSE NameTable.Given || ‘ ‘
END || CASE
WHEN ifnull(NameTable.Nickname, ”) = ”
THEN ”
ELSE ‘(‘ || NameTable.Nickname || ‘) ‘
END || ifnull(NameTable.Surname, ”) || CASE
WHEN ifnull(NameTable.Suffix, ”) = ”
THEN ”
ELSE ‘, ‘ || NameTable.Suffix
END AS [PersonsName],
CASE
WHEN PersonTable.Sex = 0
THEN famSpouse.MotherID
ELSE famSpouse.FatherID
END SpouseRefsNo,
CASE
WHEN ifnull(spouseName.Prefix, ”) = ”
THEN ”
ELSE spouseName.Prefix || ‘ ‘
END || CASE
WHEN ifnull(spouseName.Given, ”) = ”
THEN ”
ELSE spouseName.Given || ‘ ‘
END || CASE
WHEN ifnull(spouseName.Nickname, ”) = ”
THEN ”
ELSE ‘(‘ || spouseName.Nickname || ‘) ‘
END || ifnull(spouseName.Surname, ”) || CASE
WHEN ifnull(spouseName.Suffix, ”) = ”
THEN ”
ELSE ‘, ‘ || spouseName.Suffix
END AS [SpousesName],
famParents.FatherID AS [FathersRefNo],
CASE
WHEN ifnull(FatherName.Prefix, ”) = ”
THEN ”
ELSE FatherName.Prefix || ‘ ‘
END || CASE
WHEN ifnull(FatherName.Given, ”) = ”
THEN ”
ELSE FatherName.Given || ‘ ‘
END || CASE
WHEN ifnull(FatherName.Nickname, ”) = ”
THEN ”
ELSE ‘(‘ || FatherName.Nickname || ‘) ‘
END || ifnull(FatherName.Surname, ”) || CASE
WHEN ifnull(FatherName.Suffix, ”) = ”
THEN ”
ELSE ‘, ‘ || FatherName.Suffix
END AS [FathersName],
famParents.MotherID AS [MothersRefNo],
CASE
WHEN ifnull(MotherName.Prefix, ”) = ”
THEN ”
ELSE MotherName.Prefix || ‘ ‘
END || CASE
WHEN ifnull(MotherName.Given, ”) = ”
THEN ”
ELSE MotherName.Given || ‘ ‘
END || CASE
WHEN ifnull(MotherName.Nickname, ”) = ”
THEN ”
ELSE ‘(‘ || MotherName.Nickname || ‘) ‘
END || ifnull(MotherName.Surname, ”) || CASE
WHEN ifnull(MotherName.Suffix, ”) = ”
THEN ”
ELSE ‘, ‘ || MotherName.Suffix
END AS [MothersName]
FROM
PersonTable
INNER JOIN NameTable ON PersonTable.PersonID = NameTable.OwnerID AND NameTable.IsPrimary = 1
LEFT JOIN FamilyTable famSpouse ON (
(
PersonTable.Sex = 0
AND famSpouse.FatherID = PersonTable.PersonID
)
OR (
PersonTable.Sex = 1
AND famSpouse.MotherID = PersonTable.PersonID
)
)
LEFT JOIN NameTable spouseName ON spouseName.IsPrimary = 1
AND (
(
PersonTable.Sex = 0
AND famSpouse.MotherID = spouseName.OwnerID
)
OR (
PersonTable.Sex = 1
AND famSpouse.FatherID = spouseName.OwnerID
)
)
LEFT JOIN ChildTable ON ChildTable.ChildID = PersonTable.PersonID
LEFT JOIN FamilyTable famParents ON famParents.FamilyID = ChildTable.FamilyID
LEFT JOIN NameTable FatherName ON famParents.FatherID = FatherName.OwnerID AND FatherName.IsPrimary = 1
LEFT JOIN NameTable MotherName ON famParents.MotherID = MotherName.OwnerID AND MotherName.IsPrimary = 1
ORDER BY
PersonTable.PersonID,
CASE
WHEN PersonTable.Sex = 0
THEN famSpouse.WifeOrder
ELSE famSpouse.HusbOrder
END
–LIMIT 100
;


niall15

Home Person

niall15
26 May 2015 17:01:15

How do I find the Home Person who is not necessarily PersonId 1?
Cheers
Niall


ve3meo

ve3meo
26 May 2015 17:53:21

It is stored in record 1 of the ConfigTable in the XML “file” stored as a Blob in the DataRec field, e.g.,
<Root><Version>6000</Version><RootPerson>1</RootPerson><Las…

This query will let you inspect the XML data
SELECT *, CAST(DataRec AS TEXT) FROM `ConfigTable` WHERE 1 LIMIT 100;

Tom


boltongenes

SQLite query required that lists Citation Details in separate columns

boltongenes
29 November 2015 02:42:23

I have looked at the Source queries but find all the ones with Citation Fields in them list all the fields together in one cell. I would like a query that lists the citation fields in separate columns. As the list of citation fields can be different between any two sources the query would have to be limited to the user specifying one of the following:

1. which Source Template to run the query for eg Basic Ancestry Database Template ( where I have multiple Master Sources based on a single Source Template it would include all of those sources), or
2. which specific Master Source for eg My English Birth Certificates (from the Master Source List).
Fields required:

RecNo, Source Name, Surname, Given Name, OwnerID, Event Type, Cit Field 1, Cit Field 2, Cit Field 3,….etc, Citation Quality

Any help would be appreciated.

thanks
Anne-Marie


ve3meo

ve3meo
29 November 2015 05:17:41

That is likely beyond the capabilities of the SQLite language and would require a higher level language and processing. At least, it is beyond me. The problem is that the column names and values you want are in XML in one column and defined by a cell in another table. SQLite does not have any native XML support.


spR6sMtno

Database Schema

spR6sMtno
06 March 2016 11:14:06

Hi folks!

I work with DBs for a few years now, but the desing of the RM6 DB is not clear for me. And I’m not in genealogy – I do this for my wife.

Currently I work on a program that imports a RM DB and generates a graphical view of the relationships for direct ancestors. But I have trouble always detecting the correct parents, and this is where I need your assistance.

I have a name, and using nametable.ownerid, I go to the person. Then the problem begins. There are at least three different tables where I could look up the parents:
childtable ( … where childtable.childid = persontable.personid) (I dont belive this table really helps me)
familytable ( select fatherid, motherid from persontable where familytable.childid = persontable.personid)
parenttable (select parentid from persontable where persontable.personid = nametable.ownerid).

Ok, enough confusion.

What’s the correct way to look up a person’s parents?

Thank you four your help!


ve3meo

ve3meo
09 March 2016 20:36:30

Just received notification of your message. Also am not able to access SQLite at moment so this is from memory and may not be accurate. Yes, PersonTable.PersonID = ChildTable.ChildID to find FamilyID WHERE RelFather =0 AND RelMother =0 to get birth parental couple. Then ChildTable.FamilyID = FamilyTable.FamilyID to get RINs of birth parents. Then FamilyTable.FatherID = NameTable.OwnerID WHERE NameTable.IsPrimary to get name of Father and likewise for mother.


Ksquared333

Merge unknown spouses

Ksquared333
05 February 2017 23:24:06

I have a good number of people where one of the spouses is unknown (usually the wife). When I imported to RM (from The Master Genealogist) a separate unknown spouse was assigned to each of the children. For instance, in TMG I had John Smith with 1 unknown wife and 5 children. In RM I have John Smith with 5 unknown wives, each with 1 child. I need a SQLite that will merge the children under the known spouse and combine all the unknown spouses.

Thanks!


Ksquared333

Ksquared333
19 February 2017 23:52:54

So I did that. I backed up my original and then restored the one you sent. I put the guy I was having trouble with in the Family View and it worked fine. Then I started checking other RINs from my list. It was all going fine until I tried 10019 and the same thing happened. When in the Family View I got a blank Family View. I closed the database and reopened it. Navigated to him through his grandparents and parents this time instead of using the Explorer, but I still got a blank Family View when I made him (10019) the primary. This isn’t happening on databases that I haven’t run the script on, so I don’t think it’s my system or my copy of RM. Would you mind having a further look around the database to see if it happens to you after you’ve looked at several. I think it happened on the 5th one I looked at. I looked at
14284, 13770, 13784, 10012, then 10019 and the blank Family View happened.


momakid

Alternate name problem

momakid
24 July 2017 13:00:10

In entering names in the suffix field for Alternate Name with name type Married, I entered some names like ( Doe Sally). With a space between the parenthesis and the D. I did the following query and got the people I wanted:
Select suffix
from nametable
where suffix like ‘( %’;

A space between the parenthesis and the percent.

So I created the following update query:
update nametable
set suffix = ‘(%’
where suffix like ‘( %’;

the problem is it wiped the names out and put (% in the suffix field.

What should the update query have been?
What query can I run to make it (Doe Sally) again?

When I run the following query:
Select suffix
from nametable
where suffix like ‘(%’;

I get the following results:
(Doe Sally)
(%
(White Snow)

I want the entries with (% fixed. Of course it would be OK to update all suffix entries because I am sure there may be some typos.

If I wanted to change the suffix name to (Sally Doe) what would the update query be? I do have husbands who have no wives and wives that have no husbands. I do not want a suffix entry in those.


ve3meo

ve3meo
24 July 2017 19:52:54

Always make a copy or backup before you modify the database. That’s the easiest way to get back to where you were so you can try again.

Use a SELECT to evaluate the expression you draft as an UPDATE before applying the UPDATE. For example, you would have seen that your UPDATE would produce the results you got from:
SELECT ‘(%’ AS Suffix where suffix like ‘( %’;

The % wild card is only a wild card, not a memory variable. You need to use the REPLACE() function:
SELECT REPLACE(Suffix, ‘( ‘, ‘(‘) AS Suffix where suffix like ‘( %’;
If satisfied, then:
UPDATE NameTable SET Suffix = REPLACE(Suffix, ‘( ‘, ‘(‘) AS Suffix where suffix like ‘( %’;

I’m unclear whether you are asking for a way to swap the first and last names already entered in Suffix or a way to populate the Suffix with the Given and Married Surname from the database records. The former would count on there being an existing Suffix entry having only two names with a space separating them. The latter would require that there be an Alternate Name fact with its type set to Married; alternatively, it would have to invent the Married Surname from the husband’s Surname. Then there is the question of handling multiple spouses – multiple Surnames.

Tom


faliondg

Fix for marriages imported thru Ancestry TreeShare _ invalid IDs cause _[Couple] were married_ sentences

faliondg
18 January 2018 21:12:03

I have 34 marriage records in my RM file with a sentence that begins with “[couple] married on…” instead of the spouse’s names. All affected marriages were from records added in Ancestry and pulled into RM. I’ve narrowed down the problem in the data: there are marriage events for each of the spouses, but the OwnerType is 0, not 1, and the FamilyID is 0 instead of the FamilyID for the couple.

Below are the changes I developed. I’ve verified the data afterwards, by data dumps and printing the narrative reports. I had to do this as a multi-step process; there may be a more way to code the SQL but I’m sure this worked.

— test table development below
— create temporary table to hold problem records

DROP TABLE IF EXISTS TesttableEventTable ;

CREATE TEMP TABLE TesttableEventTable AS
Select *
FROM EventTable
where EventType = 300
and OwnerType <> 1
Order by Date;

— this SQL Identifies the two rows where individuals also have a valid marriage record (these records to be deleted)
— and stores the data into a temporary testing table:
DROP TABLE IF EXISTS TestEventsToDELETE
;
CREATE TEMP TABLE TestEventsToDELETE AS

select * from TestTableEventTable T
Where T.OwnerID in
(Select F.FatherID from FamilyTable F
INNER JOIN EventTable E on F.FamilyID = E.OwnerID
AND E.OwnerType = 1
And E.EventType = 300
)
UNION
select * from TestTableEventTable T
Where T.OwnerID in
(Select F.MotherID from FamilyTable F
INNER JOIN EventTable E on F.FamilyID = E.OwnerID
AND E.OwnerType = 1
And E.EventType = 300
)

;
— END this SQL stores the above data into a temporary testing table

— this SQL stores the IDs to be updated into a temporary testing table:
DROP TABLE IF EXISTS TestEventsToUPDATE
;
CREATE TEMP TABLE TestEventsToUPDATE AS

Select EventID
FROM TesttableEventTable
where (EventType = 300
and OwnerType <> 1)
AND EventID not in (Select EventID from TestEventsToDELETE)
GROUP BY Date
HAVING ( COUNT (Date) > 1)
ORDER BY Date;
— END this SQL stores the IDs to be updated into a temporary testing table

— this SQL creates a second test table to run tests against and compare to first:
DROP TABLE IF EXISTS TesttableEventTable2
;
CREATE TEMP TABLE TesttableEventTable2 AS
Select *
FROM EventTable
where EventType = 300
and OwnerType <> 1
Order by Date;
— END this SQL creates a second test table to run tests against and compare to first

DROP table if exists TestEventsChangeData;

CREATE TEMP TABLE TestEventsChangeData
AS
select TETU.EventID,
TTET.OwnerID,
F.FamilyID
from TestEventsToUPDATE TETU, TestTableEventTable TTET, FamilyTable F
where TETU.EventID = TTET.EventID
And ((F.FatherID = TTET.OwnerID) OR (F.MotherID = TTET.OwnerID))
;

— These three steps, run in order, solve the problem:

BEGIN TRANSACTION;

— set OwnerID in EventTable to Family ID from FamilyTable
UPDATE EventTable

SET
OwnerID = (SELECT TestEventsChangeData.FamilyID
FROM TestEventsChangeData
WHERE TestEventsChangeData.EventID = EventTable.EventID)
WHERE
EXISTS (
SELECT *
FROM TestEventsChangeData
WHERE TestEventsChangeData.EventID = EventTable.EventID
)
;

— set OwnerType in EventTable to 1 instead of 0
UPDATE EventTable
SET
OwnerType = (SELECT 1
FROM TestEventsChangeData
WHERE TestEventsChangeData.EventID = EventTable.EventID)
WHERE
EXISTS (
SELECT *
FROM TestEventsChangeData
WHERE TestEventsChangeData.EventID = EventTable.EventID
)
;

— Delete remaining invalid records
Delete from EventTable
where EventType = 300
and OwnerType <> 1
;

COMMIT;


Trob2

Sources merged in error

Trob2
04 July 2018 19:55:27

I have accidentally merged two similar sources and now regret it!

This relates to a parish baptism, marriage and burial data for my local area. I set up separate free-form Sources for each of the three elements. Unfortunately I now have only two sources as I somehow managed to merge the baptism and burial templates.

For obvious reasons I only used the baptism Source for Birth or Baptism events and the burial Source for Death or Burial events.

It is a very simple job to recreate the two original source templates and as stated above it’s quite simple to identify which source should be used for each event.

Would it be possible to create a query which would find instances of the merged source and rewrite them (using the relevant event as key) using the correct Source template – without losing any of the individual detail data?

Thanks in advance for any help you can offer.I’m using RM version 7.5.7.0 BTW.


ve3meo

ve3meo
05 July 2018 02:58:12

The regret stems from not having a backup just prior to the merge or you’ve done a lot of changes since then before realising the error of your ways… Familiar story!

You’ll start by looking up the merged source Name in the SourceTable and noting the value of its SourceID. We’ll call this variable “SourceIDold” in the SQL statements that follow; you will substitute the value where the name is written.

Likewise for the Name of the new Birth-Baptism source to sub for “SourceIDnew”. (You don’t need a new source for the Death-Burial source – just edit the merged source.

From the FactTypeTable, the Birth and Baptism types have FactTypeID of 1 and 7 respectively.

The CitationTable points each citation to a Master Source via SourceID and to a record in the EventTable via OwnerID when OwnerType=2.

The EventTable points to a record in the FactTypeTable via its EventType value.

So a list of all Citation records of the merged source for Birth-Baptism events can be found by this query:

DROP VIEW IF EXISTS BirthCitations
;
CREATE TEMP VIEW BirthCitations AS
SELECT CitationID FROM CitationTable C
JOIN EventTable E ON C.OwnerID = E.EventID AND C.OwnerType = 2
WHERE C.SourceID=SourceIDold –plug in your value for the merged source
AND E.EventType IN (1,7)
;

–Look under Views to see the resulting list.
–Then transfer the SourceID for this list to that of your new Birth-Bapt source with this statement.

UPDATE CitationTable
SET SourceID = SourceIDnew –plug in your value
WHERE CitationID IN (SELECT CitationID FROM BirthCitations)
;

That should have repointed the Birth-Bapt citations to the new Birth-Bapt source. Now you can edit the merged source in RM to be the Death-Burial source. You’ll be editing only the Master Source (yellow) fields.

CAUTION – you will make a backup or a copy of your database first. I have tested these statements for syntax errors but not for actual results.

Good luck!

Tom

Query to Add Parents Events to RM Database #facttypes #events #sharedevent

I have recently added a Parents “fact” to everyone in my RM database who has parents. These Parents events really are new rows added to the EventTable, even though parentage is already denoted in RM by entries in the ChildTable joined with entries in the FamilyTable. The reasons for the new events are two-fold. First, it provides a good place in the RM user interface to attach evidence of parentage. Second, it improves RM narrative reports. A person’s parents are listed explicitly as a fact in a narrative report. The evidence of parentage appears with its respective Parents fact in a narrative report. And a “birth of child” event appears in a narrative report in the parents’ timelines.

The parents fact looks something like the following in my narrative reports.

1. Elza Cordelia (Elzie) Peters1–2.
Birth: 21 Dec 1898, Anderson County, Tennessee.1–2
Parents: Alva Edward Peters and Sallie Jane Cole.

The birth of child role looks something like the following in my narrative reports.

1. Alva Edward Peters1–3.
Birth: 14 Oct 1870, Scarbrough, Anderson County, Tennessee.1,4–6
Marriage: 28 Nov 1893, Anderson County, Tennessee, age 23, to Sallie Jane Cole.1,3
Birth of Child: 21 Dec 1898, Elza Cordelia (Elzie) Peters.

In order to make this work, a Parents fact has to be added to RM’s FactTypeTable from the RM user interface via Lists->Fact Type List. A sentence template must be added for the Principle role for the Parents fact. In addition, a Parent role must be added to the Parents fact.

Because I use point form sentences, my two sentence templates for the Principle and Parent role for the Parents fact are as follows.

{cr}
<b>Parents:</b>< [Parent].>
 
{cr}
<b>Birth of Child: </b> <[Date:plain]><, [Person:Full]>.

where {cr} is an actual carriage return and line feed sequence entered into the template simply be depressing the Enter key on the PC’s keyboard. The [Parent] variable works in an amazing way in RM because it lists both persons with the Parent role (the father and mother) and separates their names with “and”. The parents names are stored in the Description field of the Parents fact, so the [Parent] variable could be replaced by the [Desc] variable, but the use of the [Parent] variable causes the parents names to included in the Index of Names in a narrative report.

I used the following query to create the Parents fact for everybody in the database who has parents, with the following exceptions. The query is designed not to add the Parents fact if it’s already there. The query is designed not to add the Parents fact for dummy people in my database. The query is designed not to add the Parents fact for people without Birth facts because it uses the Birth fact to create a date and sortdate for the Parents fact.

Jerry

-- Create a view of the EventTable
-- containing only Parents events.
-- This view will be used to prevent
-- creating a Parents event for
-- any individuals who already have
-- a Parents event. The main data needed
-- is the PersonID of the individuals
-- who already have a Parents event.
-- The PersonID manifests itself in
-- the EventTable as OwnerId.
 
 
DROP VIEW IF EXISTS ParentEventView;
CREATE TEMP VIEW ParentEventView AS
SELECT E.*
FROM EventTable AS E
       JOIN
     FactTypeTable AS FT  ON FT.FactTypeID = E.EventType
     WHERE FT.Name LIKE('Parents');
 
 
 
-- Create a view of the EventTable
-- containing only Birth events.
-- These events provides an initial list
-- of candidates of people to receive
-- a Parents event. Also, many of the
-- fields for newly created Parents
-- events will be replicated from the
-- corresponding Birth event.
 
DROP VIEW IF EXISTS BirthEventView;
CREATE TEMP VIEW BirthEventView AS
SELECT Birth.*
FROM EventTable AS Birth
       JOIN
     FactTypeTable AS FT  ON FT.FactTypeID = Birth.EventType
     WHERE FT.Name LIKE('Birth');
 
 
-- Create a view of Birth events for people
-- that don't have a Parent event. This is the
-- first filtering on the list of candidates
-- of people to receive a Parents event.
 
 
DROP VIEW IF EXISTS BirthWithoutParentsEventView;
CREATE TEMP VIEW BirthWithoutParentsEventView AS
SELECT Birth.*
FROM BirthEventView AS Birth
          LEFT JOIN
     ParentEventView AS Parent ON Parent.Ownerid = Birth.OwneriD
WHERE Parent.OwnerID IS NULL;
 
-- Create a view of the NameTable
-- containing only primary names.
-- This view will be a source of
-- the names needed for the newly
-- created Parents events and will
-- prevent any names other than the
-- primary ames from being loaded
-- into -- Parents events. This
-- view also prevents Parents events
-- from being created for any dummy
-- people, designated with an asterisk
-- in the name.
 
DROP VIEW IF EXISTS NameView;
CREATE TEMP VIEW NameView AS
SELECT N.*
FROM NameTable AS N
WHERE N.IsPrimary = 1
  AND N.Surname NOT LIKE('%*%')
  AND N.Given   NOT LIKE('%*%');
 
-- This view performs most of the
-- main processing for this project.
-- It determines which people actually
-- do have parents. Actually having
-- parents is based on being in the
-- ChildTable and has nothing to do
-- with whether a Parents event exists
-- or not. This list of people with parents
-- is then matched against people who are not
-- dummy people, who do have birth
-- events, and who don't already have
-- Parents events. This view also
-- develops the data that will need to
-- be stored in the newly created
-- Parents events.
 
 
DROP VIEW IF EXISTS ChildParentsView;
CREATE TEMP VIEW ChildParentsView AS
SELECT Child.ChildID,  Child.Given  || ' ' || Child.Surname  AS ChildName,
       Father.FatherID, Father.Given || ' ' || Father.Surname AS FatherName,
       Mother.MotherID, Mother.Given || ' ' || Mother.Surname AS MotherName,
       CASE
       WHEN Father.FatherID = 0 THEN Mother.Given || ' ' || Mother.Surname
       WHEN Mother.MotherID = 0 THEN Father.Given || ' ' || Father.Surname
       ELSE Father.Given || ' ' || Father.Surname || ' and ' || Mother.Given || ' ' || Mother.Surname
       END CombinedNames,
       B.DATE,
       B.SortDate,
       B.EditDate
 
FROM  (  SELECT C.RecID,
                C.ChildID,
                N.Given,
                N.Surname
         FROM   ChildTable AS C
                  JOIN
                NameView AS N ON N.Ownerid = C.ChildID
      ) AS Child
 
           JOIN
 
      (  SELECT C.RecID,
                FM.FatherID,
                N.Given,
                N.Surname
         FROM ChildTable AS C
                JOIN
              FamilyTable AS FM ON C.FamilyID =  FM.FamilyID
                LEFT JOIN
              NameView AS N ON N.OwnerID = FM.FatherID
      ) AS Father ON Father.RecID = Child.RecID
 
           JOIN
 
      (  SELECT C.RecID,
                FM.MotherID,
                N.Given,
                N.Surname
         FROM   ChildTable AS C
                  JOIN
                FamilyTable AS FM ON C.FamilyID =  FM.FamilyID
                  LEFT JOIN
             NameView AS N ON N.OwnerID = FM.MotherID
       ) AS Mother ON Mother.RecID = Father.RecID
 
            JOIN
 
       BirthWithoutParentsEventView AS B ON B.OwnerID = Child.ChildID;
 
-- The data from the ChildParentsView needs to be used
-- twice, once to load Parents events into the EventTable
-- and again to load roles into the WitnessTable. The
-- Parents events have to be loaded into the EventsTable
-- first, and one Insert statment in SQLite cannot load
-- data into two tables. However, loading Parents Events
-- into the EventTable will cause the ChildParentsView
-- not to produce the correct results the second time it
-- is used. Therefore, the results from applying the
-- ChildParentsView will be saved into a temporary table
-- called ChildParentsTable. As a table instead of a view,
-- the data in ChildParentsTable can be used two different
-- times and remain the same data both times it is used.
 
DROP TABLE IF EXISTS ChildParentsTable;
CREATE TEMP TABLE ChildParentsTable
(ChildID,ChildName,FatherID,FatherName,MotherID,Mothername,CombinedNames,DATE,SortDate,EditDate);
INSERT INTO ChildParentsTable
(ChildID,ChildName,FatherID,FatherName,MotherID,Mothername,CombinedNames,DATE,SortDate,EditDate)
SELECT CP.*
FROM ChildParentsView AS CP;
 
 
 
-- Load new Parents facts into the EventTable.
 
INSERT OR ROLLBACK INTO EventTable
SELECT NULL AS EventID
    ,(SELECT FT.FactTypeID FROM FactTypeTable AS FT WHERE FT.Name LIKE('Parents') ) AS EventType
    ,0 AS OwnerType
    ,ChildID AS OwnerID
    ,0 AS FamilyID
    ,0 AS PlaceID
    ,0 AS SiteID
    ,DATE AS DATE
    ,SortDate AS SortDate
    ,0 AS IsPrimary
    ,0 AS IsPrivate
    ,0 AS Proof
    ,0 AS STATUS
    ,EditDate AS EditDate
    ,CAST('' AS TEXT) AS Sentence
    ,CAST(CombinedNames AS TEXT) AS Details
    ,CAST('' AS TEXT) AS Note
 FROM ChildParentsTable;
 
 
 
 --   ===========================================================================================================
 --     The following is adapted from Tom Holden to rank same date sort dates.
 --
 --     There are a number of changes by Jerry Bryan that are specific to his
 --     use case.
 --
 --        * The list of fact types which are supported is greatly increased.
 --        * Sort dates including ranked sort dates (date-n) are ranked and even re-ranked
 --          whether or not they match the date from from the fact itself, provided only
 --          that the sort dates in question match each other.
 --             . This allows same "ABT" dates to be ranked.
 --             . This allows same "year only" dates to be ranked if the sort date is
 --               1 July of the year.
 --             . This allows same "year and month only" dates to be ranked if the
 --             . sort date is the 15th of the month.
 --
 --   ===========================================================================================================
 
/* SortDateSameDayOrderCustom.sql
   2011-12-20 ve3meo
   Alters SortDates of any set of Fact types
   to a natural order when any pair or more occur on the same date.
   Could be extended to order other facts also. SortDates are effectively assigned
   (by arithmetical offsets) an absolute suffix -1, -2, ... related to the rank of the FactType.
   Affects only those events whose SortDates correspond to the Fact Date, as computed
   by a Date encoding algorithm. The algorithm does not handle Date modifiers so not all
   Event dates are handled, e.g. "Bef 1960".
*/
DROP TABLE IF EXISTS TmpFactOrder
;
CREATE TEMP TABLE IF NOT EXISTS TmpFactOrder
(Rank INTEGER PRIMARY KEY, FactName TEXT)
;
 
/* list of Fact Names, standard and custom, to be sorted, in rank order.
   Revise the list to suit your needs */
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Birth');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Parents');             -- added by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Birth Certificate');   -- added by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Christen');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Baptism');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Death');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Obituary');            -- moved up by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Death Certificate');   -- added by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Funeral');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Cremation');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Burial');
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Burial Inscription');  -- Added by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Burial GPS');          -- Added by JB
INSERT INTO TmpFactOrder (Rank, FactName) VALUES (NULL, 'Memorial');
/* revise SortDates */
UPDATE EventTable
SET SortDate = SortDate
  -6692012023  -- this offset goes to Date-1 if the event is a ranked event
  *( (
      SELECT Rank
      FROM TmpFactOrder,
           FactTypeTable
      WHERE FactName LIKE Name
      AND FactTypeID = EventType
      )>0
    )
  +1048576  -- this offset adds steps of 1 to Date-1 multiplied by (rank-1)
  *( (
      SELECT Rank
      FROM TmpFactOrder,
           FactTypeTable
      WHERE FactName LIKE Name
      AND FactTypeID = EventType
      )-1
    ) -- maps the FactType to its order
WHERE EventID
IN (SELECT EventID FROM EventTable
    INNER JOIN
    (SELECT -- matching dates
     SortDate, OwnerID, COUNT()-1 AS Matches
     FROM EventTable
     INNER JOIN FactTypeTable
     ON EventType = FactTypeID
     WHERE EventTable.OwnerType = 0
     AND Name IN (SELECT FactName FROM TmpFactOrder)
/*     AND    -- commented out by JB to handle sort dates not matching fact date when sort dates are equal to each other.
     SortDate =   -- equals encoded event Date (if not a match, suggests that user has modified SortDate so don't touch it)
       (CASE
        WHEN DATE LIKE '.%'
        THEN 1
        ELSE Substr(DATE,3,5) END
        +10000
        )*562949953421312
        + Substr(DATE,8,2)*35184372088832
        + Substr(DATE,10,2)*549755813888
        + 17178820620 */
      GROUP BY SortDate, OwnerID, EventTable.OwnerType
     )
     USING (OwnerID, SortDate)
     INNER JOIN FactTypeTable
     ON EventType = FactTypeID
     WHERE Matches
     AND EventTable.OwnerType = 0
     AND Name IN (SELECT FactName FROM TmpFactOrder)
    )
;
 
 
-- We now add Parent roles to each Parents event.
-- It is most convenient to add the Parent role
-- for the father in one INSERT and to add the
-- Parent role for the mother as a separate insert.
-- So we first create a view that joins the
-- Parent events with the ChildTable and FamilyTable
-- to get a list of Parent events and their
-- respective fathers and mothers.
 
DROP VIEW IF EXISTS ParentRoleView;
CREATE TEMP VIEW ParentRoleView AS
SELECT PEV.*,
       FM.FatherID, FM.MotherID
FROM ParentEventView AS PEV
        JOIN
     ChildTable AS CT ON CT.ChildID = PEV.OwnerID
        JOIN
     FamilyTable AS FM ON CT.FamilyID =  FM.FamilyID;
 
 
-- Load Parents roles for fathers into the WitnessTable
 
INSERT OR ROLLBACK INTO WitnessTable
SELECT NULL AS WitnessID
    ,PE.EventID AS EventID
    ,Parents.FatherID AS PersonID
    ,0       AS WitnessOrder
    ,(SELECT R.RoleID FROM RoleTable AS R WHERE R.RoleName LIKE ('Parent') ) AS ROLE
    ,CAST('' AS TEXT) AS Sentence
    ,CAST('' AS TEXT) AS Note
    ,CAST('' AS TEXT) AS Given
    ,CAST('' AS TEXT) AS Surname
    ,CAST('' AS TEXT) AS Prefix
    ,CAST('' AS TEXT) AS Suffix
 FROM ChildParentsTable AS Parents
         JOIN
      ParentEventView AS PE ON PE.OwnerID =  Parents.ChildID AND PE.Details = Parents.CombinedNames;
 
-- Load Parents roles for mothers into the WitnessTable
 
INSERT OR ROLLBACK INTO WitnessTable
SELECT NULL AS WitnessID
    ,PE.EventID AS EventID
    ,Parents.MotherID AS PersonID
    ,0       AS WitnessOrder
    ,(SELECT R.RoleID FROM RoleTable AS R WHERE R.RoleName LIKE ('Parent') ) AS ROLE
    ,CAST('' AS TEXT) AS Sentence
    ,CAST('' AS TEXT) AS Note
    ,CAST('' AS TEXT) AS Given
    ,CAST('' AS TEXT) AS Surname
    ,CAST('' AS TEXT) AS Prefix
    ,CAST('' AS TEXT) AS Suffix
 FROM ChildParentsTable AS Parents
         JOIN
      ParentEventView AS PE ON PE.OwnerID =  Parents.ChildID AND PE.Details = Parents.CombinedNames;
;
 

Identifying Events with Individual Sentence Template Customization

I recently went through an exercise of removing all sentence customization for specific events in my RM database. The purpose of this change was to allow my Point Form sentence templates from the Fact Type Table to be used in all cases.

It is not possible in the RM user interface to search for specific events that have their own customized sentence templates. To that end, I developed the following query. This is pretty specific to my own research, but it did occur to me that there might be other reasons that someone might wish to find all events with individualized sentence customization.

I removed each sentence customization in RM by hand and I used this query only to find the customizations that needed to be removed. I could have done the removals with a query, but as I was removing the sentence customizations I was also updating the Fact note and in some cases the Fact description. So it was essentially impossible to do a complete automation of the the project.

Jerry

-- Finds events with individually customized sentence templates.
-- Sentence templates that are customized in the Fact Type table are not
-- identifed, only those that are customized for a particular event for a
-- particular person in the Edit Person sceen.
--
-- This query is for standard facts only, not for shared facts.
--
-- For a query such as this, most typically I would create
-- three queries and form their UNION. The reason for the
-- three queries is to find the PersonID for individual facts,
-- the FatherID for family facts, and the MotherID for family
-- facts. But for this query, I changed the logic a bit and
-- created a single query with three result columns. Some of
-- the column values will therefore be null, but each row
-- of the query includes at least one person of interest.
--
-- There is a subtle but important point in this query. The
-- query contains a sub-query within a couple of CASE statements.
-- These sub-queries must test the OwnerID from the EventTable
-- that's outside the sub-query rather than the OwnerID from the
-- EventTable that's inside the sub-query. I'm not quite sure why
-- this is so, but the query does not work correctly otherwise.
 
SELECT CASE E.OwnerType
       WHEN 0 THEN E.OwnerID      -- individual fact, get the PersonID
       END PersonID,
 
       CASE E.OwnerType   -- family fact, get the FatherID
       WHEN 1 THEN (SELECT F.FatherID
                    FROM FamilyTable AS F
                           JOIN
                         EventTable ON E.OwnerID = F.FamilyID)
       END FatherID,
 
       CASE E.OwnerType
       WHEN 1 THEN (SELECT F.MotherID   -- family fact, get the MotherID
                    FROM FamilyTable AS F
                           JOIN
                         EventTable ON E.OwnerID = F.FamilyID)
       END MotherID,
 
       FT.Name AS Fact,
       E.Sentence AS Sentence
FROM EventTable AS E
        JOIN
      FactTypeTable AS FT ON E.EventType = FT.FactTypeID
WHERE LENGTH(E.Sentence) > 0                                   -- test to see if sentence template exists
ORDER BY FatherID, MotherID, PersonID, E.DATE;

Duplicate Search Merge Database #datadefinitions #duplicates

RootsMagic 4+ creates a database file with the same root name as the .rmgc file but with the extension .DUP when Tools > Merge > Duplicate Search Merge is started. It contains one table that serves the Merge dialog until it is exited. This database is unused thereafter until the next Duplicate Search Merge is launched at which time it is emptied and re-filled. When in use, this database is ATTACHed to the main database connected to RM’s SQLite engine.

See Sheet: ‘DUP database’ on Database Design Spreadsheets.


Query: MarkNotProblem

-- MarkNotProblem.sql
-- 2010-02-21 ve3meo
-- equivalent to a hypothetical Select All not Merged and
-- mark as 'Not a Problem' in the Duplicate Search Merge dialog,instead
-- of having to hit Alt-N repeatedly.
-- Uses the database file RMdatabasename.DUP created by Duplicate Search Merge
-- to update the ExclusionTable.
-- Use it after merging all those that are truly duplicate (sets Merged flag=1).
 
ATTACH DATABASE 'path and filename of .DUP' AS DUP;
BEGIN TRANSACTION;
INSERT OR ROLLBACK INTO ExclusionTable
SELECT NULL, 1, ID1, ID2 FROM DupTable WHERE Merged=0
EXCEPT SELECT NULL,1,ID1,ID2 FROM ExclusionTable;
END TRANSACTION;
-- END SQL

MarkNotProblem.sql

Data Definitions #datadefinitions

RootsMagic 4+ Data Definitions

See spreadsheets “DataDefsMstr” and “DataDefsFieldSort” on Database Design Spreadsheets.

Discussions & comments from Wikispaces site


romermb

Adding To/Updating File

romermb
08 January 2010 21:35:48

A few of us so far have been trying to add the Notes, etc details to the various table fields in the file referenced in this page.

Much of being able to accurately describe the fields depends upon breadth of data in one’s RM4 database, as well as of features used within the software. The more and varied the data, the more likely that an accurate and complete portrayal of the database fields and values can be made. Sometimes just an extra pair of eyes can make a difference in seeing a particular aspect, as well.

Ultimately, the more people that are able to help try to validate the Notes added and to find any discrepancies or shortcomings in them, the better the contents of the file will become.

By the way, we chose the ODS format since it’s used by the spreadsheet software package contained within the OpenOffice suite and because a number of people are likely not to own Excel.

OO is similar in scope to Microsoft Office, but is freeware. It can be downloaded at https://www.openoffice.org.

I own Excel, but we found that opening an OO ODS file in Excel and saving in ODS format within Excel resulted in some issues/discrepancies between the products. As a result, I went ahead and downloaded OO in order to also be able to work in the Calc environment so that we’d all be able to contribute to saving a file without any worry of repurcussions.

Thanks very much for any help that anyone can provide, whether taking on defining of the Notes for fields within a table, making sure that all values for a field are represented and portrayed accurately, etc. Anyone using LDS support and/or nFS (particularly) within RM4 may be of real help.


romermb
romermb
25 January 2010 14:02:39

Well, our first pass through the fields in the RM4 database tables has been completed, so the hardest part and bulk of the work are essentially done. We managed to do so all during RM 4.0.7.1, which was fortunate since the database layout or behavior of fields, etc. may’ve potentially changed between releases.

I’ve just sent comments about observations made on some fields in tables that I didn’t submit within the ODS file, so corrections to some fields in those tables could be forthcoming. After that time, we’d all certainly appreciate others looking at the data in their various RM4 database tables/fields for variations. Any feedback relating to corrections to the field descriptions in the DataDefsMstr sheet of the ODS file would be most welcome.

Thanks very much for any contributions that you’re able to make!


ve3meo

ResearchTable: Correction of Status def

ve3meo
18 January 2010 16:15:04

I found the workbook really helpful in doing the To_Do query. Found and corrected errors in the Status def.

232 ResearchTable Status I 0-3 Status (Status, from Edit ToDo item screen (TaskType = 0): 0 = Open, 1 = Completed, 2 = Pending, 3 = Problem; Sent or Received, from Edit Correspondence screen (TaskType = 1): 0 = Sent, 1 = Received)


ve3meo

ve3meo
18 January 2010 16:24:59

Oops. I posted this without realising that Romer had uploaded a revised workbook so my corrections have yet to be incorporated. Great work, Romer!


ve3meo

CitationTable.Quality misrepresented on web page

ve3meo
18 January 2010 17:23:08

Three tildes in a row is used as an example of Quality (Don’t Know x3). Wikitext detects two tildes as a code for the user who last edited the page, e.g. – ve3meo ve3meo , thus misrepresenting the value. Weird!


ve3meo

ve3meo
18 January 2010 19:36:22

Surrounding with backtick characters should do the trick:
– ve3meo ve3meo or `– ve3meo ve3meo`
– ve3meo ve3meo Jan 18, 2010 oe `– ve3meo ve3meo Jan 18, 2010`
– ve3meo ve3meo or `~`~~ or `~~~`

But then it will look funny in the spreadsheet.


ve3meo

CitationTable.OwnerType = 7 ???

ve3meo
29 January 2010 14:21:47

I’ve encountered a few records in the CitationTable where the OwnerType=7. Some of them correspond to odd results in RM4’s Reports > Lists > Source List report:
1. The first (and sometimes only) listed citation for the source is the source itself.
2. In one case, a citation with a unique detail that shows in the Edit Person screen of a woman’s Alternate Name fact is reported against her husband’s Birth fact. The same source is cited with different detail for his Birth fact and is correctly reported.
3. There remain some others with the value 7 for which no anomalous behaviour is readliy detected in the Source List report.

The CitationTable.OwnerID value for these does not make any sense. They do not point to any relevant records in the same or any other table.


romermb

romermb
30 January 2010 06:13:39

Very strange! I couldn’t locate any in my database, but the only thing that I might suggest would be to go ahead and try the following query and see if any patterns emerge (or at least any thoughts as to how the sources themselves might’ve been used):

SELECT *
FROM CitationTable
LEFT OUTER JOIN SourceTable ON
CitationTable.SourceID = SourceTable.SourceID
WHERE CitationTable.OwnerType = 7


ve3meo

DataDefs for DUP database added.

ve3meo
21 February 2010 04:16:28

Spreadsheet revised with a sheet added for DUP database, the .DUP file created by the Duplicate Search Merge tool. maybe it should be integrated with the Master DataDefs sheet because it does function as a temporary table in relation with the permanent tables.


thejerrybryan

PersonTable.UniqueID

thejerrybryan
01 July 2011 15:35:28

PersonTable.UniqueID appears as hex in both SQLite and MS Access. The usual tricks to coerce it into appearing as text don’t seem to work – CAST for SQLite and StrConv – because the functions leave the UniqueID field in hex. Does anybody know how to coerce UniqueID into text?

Jerry


ve3meo

ve3meo
02 July 2011 03:52:16

UniqueID is a hex coded string, viz.the table def:
CREATE TABLE PersonTable (PersonID INTEGER PRIMARY KEY, UniqueID TEXT, …
I’m not sure what the problem is. Concatenating it with text results in text:
SELECT ‘UID=’||UniqueID FROM PersonTable;

Tom