Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get a query to output to a .dbf file??? 1

Status
Not open for further replies.
Apr 19, 1999
9
0
0
US
Visit site
Is there a way to get a query to output to a .dbf file. Not just so that it is named .dbf, but that it actually has the formatting correct? <br>
If not, does anyone know how to convert a .csv file to a valid .dbf file?<br>
Thanks in Advance.<br>

 
Just open the CSV in excel and save as DBF. If the file is huge, u may need to use a tool dBase or FoxPro/Access to import it into a DBF format.
 
How would I get the output of the query into a csv vile? It comes out just in plain text, with no type of formatting?
 
If you use the query on the Oracle Browser you can save the result into a csv file, select the export option and the type of file you which.
 
Or, if you can't do that, you can format the output of your select by writing your SELECT statement like this:<br>
<br>
SELECT '"' ¦ fld_1 ¦ '","' ¦ fld_2 ¦ '","' ¦ fld_3 ¦ '"'<br>
FROM tbl_a<br>
WHERE some_field = 'A VALUE'<br>
<br>
That will give you a .csv file - you will need to strip out the headers and such but once that's done you can just import it straight into Excel.<br>
<br>
Mike<br>

 
If u have Visual Foxpro it would be very easy. Just follow these steps.<br>
1. In the Visual Foxpro command window , use the function<br>
SQLCONNECT() to connect to Oracle.<br>
2. Use the function SQLEXEC() to run a query.<br>
(eg) SQLEXEC(Handle,&quot;Select * from Emp&quot;)<br>
3. If u give BROW the results are dispayed in VFP browser.<br>
4. Close the browser and give the following command to <br>
convert ur query into DBF format.<br>
COPY TO &lt;FILENAME.DBF&gt;<br>
<br>
Hope this Helps u<br>
<br>
Vinod<br>

 
If u have Visual Foxpro it would be very easy. Just follow these steps.<br>
1. In the Visual Foxpro command window , use the function<br>
SQLCONNECT() to connect to Oracle.<br>
2. Use the function SQLEXEC() to run a query.<br>
(eg) SQLEXEC(Handle,&quot;Select * from Emp&quot;)<br>
3. If u give BROW the results are dispayed in VFP browser.<br>
4. Close the browser and give the following command to <br>
convert ur query into DBF format.<br>
COPY TO &lt;FILENAME.DBF&gt;<br>
<br>
Hope this Helps u<br>
<br>
Vinod<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top