How Do I Dump Data from a Database Table to a Text File? (Magic xpa 4.x)
It is often useful to dump data from a database table into a text file, to send data to a spreadsheet, to another application, or to convert the data within Magic xpa. Magic xpa provides a utility to do this automatically, the Generate Program utility (Options->Generate Program, or Ctrl+G).
-
In the Data repository, position the cursor on the table you want to view.
-
Press Ctrl+G (Options->Generate Program).
-
Select:
-
Zoom from the Columns field to select only certain columns, if you want, and to change their order, if you want.
-
For Text file, enter the name of the text file you will create.
-
Press Enter or click OK.
If you selected Mode=Execute, the data will be exported into the text file you specified.
If you selected Mode=Generate, then there will be a new program in the Program repository. You can run this program by pressing F7.
Note: A plain text export can be very useful, but has some limitations. The particular problem happens to be memo fields which may contain a CR/LF, or BLOB fields. These sorts of files may require something more involved, such as XML output.