[tngusers2] How best to delete an Appended Gedcom [maybe viaSQL?]

Joyaa Antares joyaa at goldcoastosteopathy.com.au
Sat Jul 4 08:49:17 CDT 2009


Thanks Diana,

I'll look at this carefully before trying anything.  This is definitely 
along the lines I am looking for and yes, I will back up before running the 
query.

Fingers crossed that a European time-zone SQL afficionado will assist .... 
(crossing fingers)

Joyaa

----- Original Message ----- 
From: "Diana Gale Matthiesen" <DianaGM at dgmweb.net>
To: "'TNG Users List'" <tngusers2 at lythgoes.net>
Sent: Saturday, July 04, 2009 10:07 PM
Subject: Re: [tngusers2] How best to delete an Appended Gedcom [maybe 
viaSQL?]


> Forewarning:  my knowledge of SQL is based on using it years ago (to 
> manage
> catalogs of museum specimens, before I retired).  I've never used it on my 
> TNG
> database.
>
> No, you don't SELECT records, first.  The SQL command to delete records is
> DELETE.  The syntax is:
>
> DELETE FROM tablename WHERE condition ORDER BY ... LIMIT row_count
>
> You must specify a condition or *all* records will be deleted.  I would
> definitely do a backup of your database before attempting any sort of 
> "delete on
> condition" command.
>
> You won't need "ORDER BY," but you may want to LIMIT the number of records 
> you
> will allow to be deleted.  In fact the first time you run the command, I 
> would
> limit it to one or two records, to make certain it's doing what you intend 
> it to
> do because unless you get the condition exactly right, it can have 
> unexpected
> consequences.  To test whether the records that will be deleted are the 
> ones you
> want deleted, I would run the SELECT command first:
>
> SELECT familyID FROM tablename WHERE familyID > 'F1987' LIMIT 1300
>
> If the records listed are the ones you want deleted, then run the same 
> command
> using DELETE.
>
> Another useful conditional operator is "BETWEEN":
>
> DELETE FROM tablename WHERE familyID BETWEEN 'F1987' AND '___'
>
> obviously using whatever the highest familyID is that you want deleted for 
> the
> second value.
>
> My uncertainly here stems from my not remembering how the operators > and
> BETWEEN behave with  different field types.  I presume familyID is a 
> string
> field.  I wouldn't jump in, but it's a holiday weekend and you may not get 
> many
> responses.
>
> Diana
> 





More information about the tngusers2 mailing list