Home » RDBMS Server » Server Utilities » Convert oracle table into a .dbf file
Convert oracle table into a .dbf file [message #137044] Mon, 12 September 2005 23:55 Go to next message
Avra
Messages: 65
Registered: July 2004
Member
Hi,

I am using Oracle8i On Windows 2000 Prof. I need to convert 1 oracle table into .dbf format... How can it be done?

Thanks in advance....

Avra
Re: Convert oracle table into a .dbf file [message #137270 is a reply to message #137044] Wed, 14 September 2005 03:44 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member

Can the steps mention below helps u ?

1. create a .sql file for eg:

test.sql
Quote:



set heading off
set feedback off

spool &&1

select * from table_test;

spool off

set heading on
set feedback on

exit




2. then run this .sql file from command prompt like this :

c:\> sqlplus username/password c:\test.sql c:\test_output.dbf



U can try this out , the result of the table data will be spooled out in test_output.dbf.


regards,
tarun

Re: Convert oracle table into a .dbf file [message #137312 is a reply to message #137270] Wed, 14 September 2005 09:23 Go to previous messageGo to next message
Avra
Messages: 65
Registered: July 2004
Member
Hi,

The data is being converted in a .dbf file by following your steps. But the problem is that Foxpro is not able to open the file... It's showing not a database file...

Pls help...

Thanks,

Avra
Re: Convert oracle table into a .dbf file [message #137334 is a reply to message #137312] Wed, 14 September 2005 13:08 Go to previous message
Barbara Boehmer
Messages: 9101
Registered: November 2002
Location: California, USA
Senior Member
Spooling from Oracle will put the data into an ascii text file, not a foxpro database file (.dbf). I would suggest adding a delimiter, for example use "set colsep ','" to create a comma-separated value (.csv) file, then create an empty FoxPro table of the same structure and use your FoxPro utilities to load the text file into the database file. It has been a long time since I used FoxPro and I mostly converted FoxPro to Oracle, not the other way around, but I believe the FoxPro append command was what I used to load .csv into .dbf. I recall that FoxPro was a little picky about file extensions, so you may need to make sure that your delimited ascii text data file ends in .txt. I used FoxPro 2.6 for DOS, so things may be different nowadays using Visual FoxPro. Just out of curiosity, why are you doing this? Most people migrate from FoxPro to Oracle, not the other way around. Also, if you give us a bigger picture of what you are doing, there may be a better way, like ODBC or some such thing. Is this a one-time thing or something you will be doing on a recurring basis? You might also see if you can find a FoxPro forum and see what they say there.

Previous Topic: getting error SQL*Loader-350
Next Topic: Increasing Buffer size while import is running
Goto Forum:
  


Current Time: Thu Dec 26 06:20:30 CST 2024