[Babase] Re: YIKES...what IS this?
Karl O. Pinc
kop at meme.com
Thu Sep 11 18:48:40 EDT 2008
On 09/11/2008 03:18:48 PM, kfenn wrote:
> I'm uploading to PREGS in babase. I uploaded a similar pregs file
> (similar to the one attached) to babase_test with no problem but I
> got this error message in babase. I say the file was similar because
> every time I enter the pregs I have to go back to the database and
> get the new dcpid's created from the most recent cycles upload (so
> the error could be in my dcpid input...although I've never seen a
> message like this one before). ECH is not in the pregs file I'm
> trying to upload and as far as I can tell she had ECH8, then a normal
> resume file in June 08. It's possible I pulled her dcpid and tried
> to give another female her conceptive cycle, but I did a quick search
> and find and i didn't see her dcpid for June.
>
>
> ERROR: ECH8: 9: Parity out of sequence: Mismatch with preceeding
> pregnancy
<snip>
Your exactly right as to the problem. CYCLES.Cpid 54773
belongs to ECH, not OXY.
I found this with a query that looks like:
select sname, cpid from cycpoints, cycles where cycpoints.cid =
cycles.cid and sname = 'ECH' and (cpid = '54437' or cpid = ...);
Rather than insert directly into the table you may find it
better to do a bit of text manipulation ahead of time
(search and replace on a table like the one you
attached, or do a macro, or even cut and paste)
and write a little sql script that'd look like:
begin;
insert into pregs (pid, parity, conceive)
select 'MBE3', 3, conceive.cpid
from cycpoints_cycles as conceive
where conceive.sname = 'MBE'
and conceive.date =
(select max(date)
from cycpoints_cycles
where cycpoints_cycles.sname
= conceive.sname
and date < 'whateverbirthdate');
insert into pregs (pid, parity, conceive)
select 'NOO2', 2, conceive.cpid
from cycpoints_cycles as conceive
where conceive.sname = 'NOO'
and conceive.date =
(select max(date)
from cycpoints_cycles
where cycpoints_cycles.sname
= conceive.sname
and date < 'whateverbirthdate');
...
commit;
You substitute in the pid, parity, sname,
and birthdate of the offspring. Assuming CYCLES
is right it finds the Zdate for you. (Don't
forget the begin and commit so the update is all or
nothing.)
Karl <kop at meme.com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
More information about the Babase
mailing list