[Babase] Re: queries

Karl O. Pinc babase@www.eco.princeton.edu
Tue, 12 Oct 2004 21:10:38 -0500


On 2004.10.12 16:49 Stephanie Combes wrote:
> Hi Karl,
> 
>  Here are my thoughts (and questions) on querying the tables:

Better run this by Daphnie too.

> 
> 1.  Is all we really want a known ordered text version of each 
> table?  In which case, it's pretty simple to get that from foxpro.  
> Here's what I think we could order by to get the same, known order 
> for each:
> 
> biograph - order by birth
> pregs - order by pid
> cycles - order by cid
> census - order by cenid
> demog - order by cenid
> ranks - order by sname,rnkdate
> parts - iid, sname
> interact - iid
> 
> In which case, all we'd have to write in foxpro is:
> 
> select * from biograph to file biograph order by birth

select * from biograph to file biograph order by sname

(There could be two with the same birth.)

But I need the columns spelled out

birth, bstatus, sex, matgrp, ...

just using '*' won't do because I need to duplicate the column ordering.

ranks by sname, rnkdate, rnktype  (Daphnie?)

You're missing tables:

members
repstats
cycstats
samples
jpsamps
fpsamps
jpneighbors
fpneighbors

and all the support tables
ncodes
acts
etc.

> 
> 
> (I would, by the way, do this and put the result into the "foxdata" 
> location, but I can't remember how to copy stuff there. sigh. I am 
> unix challenged).

You will want it in a directory on your pc and then

scp yourdirectory/*.* 
slc8@login.biology.duke.edu:/biology/groups/babase/foxdata/

(tho I forget the windows side, does *.* still work?)

> 
> 2.  Notice I skipped a few tables for what to order by.  So, we are 
> still skipping sexskins, right?  In which case I'll ignore it.

Go ahead and skip sexskins because we'll have no data in postgresql 
(pg).

> I'm a little confused about comparing cycstats and repstats.  Are 
> these tables that are generated each time you are doing the 
> conversion? In which case, they aren't really comparable to our old 
> tables? Or is that wrong?  I can easily figure out what to order 
> those tables by if we need them too.  What about members? regenerated?

Just because they're regenerated does not mean that they should not
be the same on both systems when we get done, so we have to compare 
them.

> 
> 3.  I'm assuming I need to query the weird point sample/psion data 
> tables also?  What about support tables?  I'm assuming something like 
> "groups" doesn't need to go in.

Gotta compare it all.

> 
> That's it for this second. Stay tuned.
> -steph
> 
> p.s. went to stalk Hunter several times today, but he's hiding from 
> me. lost the battle, but not the war!
> 
> 

Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."
                  -- Robert A. Heinlein