473,471 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Exporting data into a text file

Claus Mygind
571 Contributor
I have been able to create a text file on the MySQL host server using this technique.

The SELECT ... INTO OUTFILE statement is intended primarily to let you very quickly dump a table to a text file on the server machine.
However is there a way to progromatically incorporate the following into an application.

If you want to create the resulting file on some client host other than the server host, you cannot use SELECT ... INTO OUTFILE. In that case, you should instead use a command such as mysql -e "SELECT ..." > file_name to generate the file on the client host.
My application is a client web app. The user calls the web server executes the program and I would like the resulting .txt file to be stored on one of our network drives other than the MySQL data server.
Mar 16 '09 #1
2 3221
r035198x
13,262 MVP
Which programming language?
Mar 20 '09 #2
Claus Mygind
571 Contributor
well you will not believe it but dBase. I think I finally got the answer to my question however.

First I tried something which is not very sound. I granted the user file privilege, which of course is too grand. So not being happy with that I went back to the drawing board.

As this is a web application, I determined that I could export the data into notepad in a text format and the user can save the data right on their desktop computer (client). Here is my code.
Expand|Select|Wrap|Line Numbers
  1. puts("Content-type: application/vnd.ms-notepad")
  2. puts("Content-Disposition: filename='test.txt'")
  3. puts('')
  4. do
  5. c1 = f[1].value 
  6. c2 = f[2].value 
  7. c3 = f[3].value 
  8. c4 = f[4].value 
  9. c5 = f[5].value 
  10. cValue = ["]+c1+[","]+c2+[","]+c3+[",]+c4+[,]+c5
  11. puts( cValue )
  12. until not q.rowset.next()
  13.  
In this example I output 3 alphanumeric fields (text strings) and two numeric fields. and it works beautifully.

So thanks for your offer of help.
Mar 20 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: D | last post by:
I've created a report with many subreports of aggregate data. I want my client to be able to export this data to Excel to make her charts, etc. Only one problem: one of the fields is a "SchoolYear"...
2
by: ASIF | last post by:
Does anyone klnow of a quick way of exporting data from access to a text doucument, the data needs to be tab seperated, and the data to be exported needs to be selected using parameter queries. I...
4
by: Hitesh | last post by:
Hi, I have three datagrid control on my aspx page and one export to excel button, i want to export all the 3 datagrids contents in one excel file. how can i achive that? -- Thanks Hitesh
2
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
6
by: sara | last post by:
I have what I think is a little strange...I have to get data from our payroll system into a specific format (fixed record length) as a .txt or .prn file only to upload to our 401k custodian. I...
16
by: pmatzek | last post by:
I am attempting to automate a process involving importing a .txt file into an existing table, changing a date in each record, then exporting the table, again as a .txt file. One field contains a...
0
by: =?Utf-8?B?ZGVuIDIwMDU=?= | last post by:
hi, I trying to export data display on a gridview that supports any language (like chinese, japanese, thai, french) shown here is chinese only. There is no problem exporting english language...
1
by: Marty Klunk | last post by:
I have an Access97 data base where we are exporting records out to a text file that is then sent to a customer via EDI transmission. The problem I am having is that during the export process access...
2
by: JimmyKoolPantz | last post by:
We purchased som software for encoding a barcode. We want to automate the process of converting a number to a readable barcode. However, I am having a few issues. The file that the barcode...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.