[Babase] Re: Putting Foxpro files on the web

Karl O. Pinc babase@www.eco.princeton.edu
Tue, 04 Oct 2005 21:30:26 +0000


On 10/04/2005 03:05:46 PM, Leah Gerber wrote:
> Hi Karl,
> 
> We have three free standing foxpro files that we would like to put on  
> the web so Russ can query them. Could you help me do this? Should  
> Russ go through Hunter or you to get a babase login name?

Ok...

Russ writes me for a babase login name. I write back with
password and tell him to change it.

Will Russ have write privileges or only read privileges?
(To babase in general.)

You will use the COPY statement:
http://www.postgresql.org/docs/8.0/static/sql-copy.html

Read first, then do this:

1) export from foxpro, either as CSV or delimited text

2) On papio create /scratch/babase/tmp/ directory

3) copy exported files from your workstation to
    papio:/scratch/babase/tmp/ directory.

4) Create a table for each file in the babase database,
    sandbox schema.  Use either the phppgadmin wizard
    or the CREATE TABLE statement.  (I'd prefer the latter
    so you can keep a record of what you did.)
    http://www.postgresql.org/docs/8.0/static/sql-createtable.html
    CREATE TABLE sandbox.foo (id int, sname char(3));

5) Use COPY to populate the table from the (example)
    file(s) with a full pathname of /scratch/babase/tmp/foo.
    This can be done from phppgadmin.  Or use the \copy command
    in the Unix psql command which is very similar.

6) erase the papio:/scratch/babase/tmp/ directory and contents.

Contact me with questions.

Please tell me if you keep anything that's not a copy
as I occasionally still destroy _everything_ and start over.

If you like, test all of the above first using the
babase_test database intead of the babase database,
as that's what it's for.

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