From 26bb1508e86672321c626990c65679d1ede422d6 Mon Sep 17 00:00:00 2001 From: johnandrea <46268748+johnandrea@users.noreply.github.com> Date: Mon, 15 Apr 2024 23:03:12 -0300 Subject: [PATCH] Fix missing space in subselects --- step2-make-insert.sql | 6 +++--- step4-new-values.sql | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/step2-make-insert.sql b/step2-make-insert.sql index 0cf6ae0..3cdf115 100644 --- a/step2-make-insert.sql +++ b/step2-make-insert.sql @@ -3,7 +3,7 @@ -- This code is released under the MIT License: https://opensource.org/licenses/MIT -- Copyright (c) 2024 John A. Andrea --- v1.0 +-- v1.1 .headers off .separator "" @@ -14,13 +14,13 @@ select 'insert into EventTable (Details,FamilyId,OwnerType,OwnerId,EventType) va 0, ', ', 0, ', ', PersonID,', ', -(select FactTypeID from FactTypeTable where Name like'6levels'), +(select FactTypeID from FactTypeTable where Name like '6levels'), ');' from PersonTable where PersonID not in (select OwnerID from EventTable where EventType = - (select FactTypeID from FactTypeTable where Name like'6levels') + (select FactTypeID from FactTypeTable where Name like '6levels') ) ; diff --git a/step4-new-values.sql b/step4-new-values.sql index 520d7f6..f28fc1d 100644 --- a/step4-new-values.sql +++ b/step4-new-values.sql @@ -2,7 +2,7 @@ -- This code is released under the MIT License: https://opensource.org/licenses/MIT -- Copyright (c) 2024 John A. Andrea --- v1.0 +-- v1.1 -- heavy on the subselectes -- appears that zero is used frequently instead of null, not sure if due to SQLite or RootsMagic @@ -11,14 +11,14 @@ update EventTable set Details='1' where Details like '' and OwnerType = 0 -and EventType=(select FactTypeID from FactTypeTable where Name like'6levels') +and EventType=(select FactTypeID from FactTypeTable where Name like '6levels') ; -- upgrade 1 to 2 for birth / death update EventTable set Details='2' where Details like '1' and OwnerType = 0 -and EventType=(select FactTypeID from FactTypeTable where Name like'6levels') +and EventType=(select FactTypeID from FactTypeTable where Name like '6levels') and OwnerId in (select OwnerId from EventTable where EventType in @@ -32,7 +32,7 @@ and OwnerId in update EventTable set Details='2' where Details like '1' and OwnerType = 0 -and EventType=(select FactTypeID from FactTypeTable where Name like'6levels') +and EventType=(select FactTypeID from FactTypeTable where Name like '6levels') and ( OwnerId in (select FatherId from FamilyTable where FamilyId in (select OwnerId from EventTable @@ -63,7 +63,7 @@ and ( OwnerId in (select FatherId from FamilyTable update EventTable set Details='3' where Details like '2' and OwnerType = 0 -and EventType=(select FactTypeID from FactTypeTable where Name like'6levels') +and EventType=(select FactTypeID from FactTypeTable where Name like '6levels') and OwnerId in (select OwnerId from EventTable where EventType in @@ -77,7 +77,7 @@ and OwnerId in update EventTable set Details='3' where Details like '2' and OwnerType = 0 -and EventType=(select FactTypeID from FactTypeTable where Name like'6levels') +and EventType=(select FactTypeID from FactTypeTable where Name like '6levels') and OwnerId in (select FatherID from FamilyTable where FamilyID in (select OwnerId from EventTable where EventType in @@ -98,7 +98,7 @@ and OwnerId in update EventTable set Details='3' where Details like '2' and OwnerType = 0 -and EventType=(select FactTypeID from FactTypeTable where Name like'6levels') +and EventType=(select FactTypeID from FactTypeTable where Name like '6levels') and ( OwnerId in (select FatherId from FamilyTable) or OwnerId in (select MotherId from FamilyTable) ) @@ -108,7 +108,7 @@ and ( OwnerId in (select FatherId from FamilyTable) update EventTable set Details='3' where Details like '2' and OwnerType = 0 -and EventType=(select FactTypeID from FactTypeTable where Name like'6levels') +and EventType=(select FactTypeID from FactTypeTable where Name like '6levels') and ( OwnerId in (select FatherId from FamilyTable where FamilyId in (select FamilyId from ChildTable) @@ -125,7 +125,7 @@ and ( OwnerId in (select FatherId from FamilyTable update EventTable set Details='4' where Details like '3' and OwnerType = 0 -and EventType=(select FactTypeID from FactTypeTable where Name like'6levels') +and EventType=(select FactTypeID from FactTypeTable where Name like '6levels') and OwnerId in (select OwnerId from EventTable where EventType in