I have noticed that there often is a need to dump database information into a CSV file. Users then can useExcel or a similar program to manipulate the data. These utilities are easy to use, flexible, and fast.There are 2 utilities for Oracle, 2 for Microsoft SQL, and 2 for SQLite. They convert a table or SQL into a CSV file.

Oracle: OracleTableToCSV.exe Converts an entire table into a CSV file. OracleQueryToCSV.exe Converts an SQL query result into a CSV file.

Microsoft: MSTableToCSV.exe Converts an entire table into a CSV file. MSQueryToCSV.exe Converts an SQL query result into a CSV file.

SQLite: SqliteTableToCSV.exe Converts an entire table into a CSV file. SqliteQueryToCSV.exe Converts an SQL query result into a CSV file.

@chesterw: It would be nice to hear how you made this (start by using the NANY template in your post), any future plans you have with this, and as a developer I'm interested in the technology stuff used as well.

Scanners like to mark any exe that has been compressed (like with UPX) as potential malware. The scanners are probably ticked off that they would have to go through an unpacking process to scan the payload properly, so being the lazy curs that they are, they opt to just mark it as bad stuff without really checking.

That said, I am curious why people still pack their exe's these days. Disk space isn't nearly the problem it was years ago, when storage topped out in the low gbs, and bandwidth savings can't possibly be a real concern unless you're going to get millions of downloads.

Because Delphi is such a popular tool throughout the world, those who write viruses often use Delphi. Normal library routines in Delphi produce strings of characters in most Delphi programs. In error, some antivirus heuristics look for those strings of characters and automatically label (falsely) a program as a virus. So if I submit a program in Delphi, it pretty much is guaranteed to be falsely labeled as a virus by some antivirus program. Packers like UPX compress the final EXE significantly, which speeds up file transfers, and has the added benefit of avoiding the false positives of some antivirus software. But then, as pointed out above, they complain that you used UPX to pack the EXE. I can't win...

Delphi is quite versatile in its database capabilities. The 6 programs here are really just 2 programs, with slight changes for 3 different databases. The trick used in the 3 "dump out a table" programs was to discover 3 different ways to get the list of columns. Every database does it differently. Once I had the list of column names, and put them at the top of the CSV file, I did a "SELECT * FROM tablename" and wrapped each field with double-quotes and commas, to make a "safe" CSV file, as a field can contain commas.

The other 3 programs for getting the result of a query have the user give me the column names, and a (hopefully pre-tested) query that matches those column names. Using a similar process as above, I create the CSV file.

The real versatility is using the batch/CMD files to do the routine stuff like passwords, and allow the flexibility of dumping different tables or running a set of custom SQL files. Enjoy!

I honestly wish more people would come back to Delphi (or Free Pascal, whatever floats your boat) so I can have more reasons to use Delphi for new projects because of a sane ecosystem. As it stands, every additional Delphi Unit that does not come from Embarcadero (or whatever their current name is) is pretty much left to rot.

07/02/2018 - In the 3 QueryToCSV files: Corrected a bug that added a blank column to the output file. Enhanced error messages. Added an N parameter: Output file has a header unless there is this parameter.