Skip to content

Commit

Permalink
Fix missing space in subselects
Browse files Browse the repository at this point in the history
  • Loading branch information
johnandrea authored Apr 16, 2024
1 parent 176daf5 commit 26bb150
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions step2-make-insert.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand All @@ -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')
)
;

Expand Down
18 changes: 9 additions & 9 deletions step4-new-values.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
)
Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 26bb150

Please sign in to comment.