Thread: dbf2pg, visual foxpro and other nonsense

dbf2pg, visual foxpro and other nonsense

From
"Mike McCormac"
Date:
i've been importing older foxpro tables (x-base files) into postgresql
with much success using dbf2pg... however, visual foxpro files don't
seem to work — i just get an error.

does anyone know of any successful means of importing this data
directly?  our backend application is built in java... are there any
good solutions with JDBC??

this is relatively urgent, so if anyone who replies can CC me at this
email, i'd be much appreciated.

thanks,
mike


Re: dbf2pg, visual foxpro and other nonsense

From
Jeremy Buchmann
Date:
On Tuesday, July 9, 2002, at 10:27 AM, Mike McCormac wrote:

> i've been importing older foxpro tables (x-base files) into postgresql
> with much success using dbf2pg... however, visual foxpro files don't
> seem to work — i just get an error.
>
> does anyone know of any successful means of importing this data
> directly?  our backend application is built in java... are there any
> good solutions with JDBC??
>

You can copy the Foxpro tables to text and then copy them into Pg.

The problem is, Foxpro likes to make its data "dirty" by surrounding text
with quotes, inserting newlines for no reason and things like that, so
you may need to write a script or something that strips all that crap
out.

Have fun.

--Jeremy



Re: dbf2pg, visual foxpro and other nonsense

From
Darko Prenosil
Date:
On Tuesday 09 July 2002 16:27, Mike McCormac wrote:
> i've been importing older foxpro tables (x-base files) into postgresql
> with much success using dbf2pg... however, visual foxpro files don't
> seem to work — i just get an error.
>
> does anyone know of any successful means of importing this data
> directly?  our backend application is built in java... are there any
> good solutions with JDBC??
>
> this is relatively urgent, so if anyone who replies can CC me at this
> email, i'd be much appreciated.
>
> thanks,
> mike
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Are You FoxPro programmer ?
If Yes, write simple program that reads table by table and generate PostgreSQL
CREATE TABLE and INSERT INTO expressions. Save the file and execute it with
psql. Before about a year i did  wrote such conversion program. If you need
it, let me know and I'll try to find it.




Re: dbf2pg, visual foxpro and other nonsense

From
kklein
Date:
If you have the Visual Foxpro IDE, you can convert a VFP .dbf to a 
FoxDOS format using the command COPY TO filename FOX2X, then use dbf2pg 
on the resulting file.



Mike McCormac wrote:
> i've been importing older foxpro tables (x-base files) into postgresql
> with much success using dbf2pg... however, visual foxpro files don't
> seem to work -- i just get an error.
> 
> does anyone know of any successful means of importing this data
> directly?  our backend application is built in java... are there any
> good solutions with JDBC??
> 
> this is relatively urgent, so if anyone who replies can CC me at this
> email, i'd be much appreciated.
> 
> thanks,
> mike
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org




Re: dbf2pg, visual foxpro and other nonsense

From
marian beier
Date:
I could not find any final solution for converting Visual FoxPro dbf 
files to postgress.
If somebody has a script, or a new version of dbd2pg, which works with 
this dbf files, please let me know ASAP. I'm running FreeBDS, and found 
dbf2pg, in databases/postresql81-server/work/contrib
I would need a similar tool to runn it in a script from crond, so a 
"COPY TO filename FOX2X" would not help me too much.
Thank you, Marian.


Re: dbf2pg, visual foxpro and other nonsense

From
"Joshua D. Drake"
Date:
marian beier wrote:
> I could not find any final solution for converting Visual FoxPro dbf 
> files to postgress.
> If somebody has a script, or a new version of dbd2pg, which works with 
> this dbf files, please let me know ASAP. I'm running FreeBDS, and found 
> dbf2pg, in databases/postresql81-server/work/contrib
> I would need a similar tool to runn it in a script from crond, so a 
> "COPY TO filename FOX2X" would not help me too much.
> Thank you, Marian.

Use ODBC to connect to Foxpro and link to PostgreSQL :)

Joshua D. Drake

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
> 


-- 
            === The PostgreSQL Company: Command Prompt, Inc. ===      Sales/Support: +1.503.667.4564 || 24x7/Emergency:
+1.800.492.2240     Providing the most comprehensive  PostgreSQL solutions since 1997
http://www.commandprompt.com/