I'm trying to export some data from a Firebird database, with FBExport to a CSV file. The problem is I have two different errors. I spent a few hours to try different combinations:
- Unknown switch -
- Switches must begin with -
The command I tried:
fbexport -Sc -Q -F h:\AABBCC\export.csv -B -D h:\AABBCC\XXYYZZ.FDB -U "MMNNOO" -P "PPQQRR" -X "select PATIENTS.IPP, PATIENTS.NOM, PATIENTS.NOM_MARITAL, PATIENTS.NOM_USUEL, PATIENTS.PRENOMS, dmc.NUM_DOSSIER_PAPIER, dmc.NUM_DOSSIER_PAPIER_2, dmc.NUM_DOSSIER_PAPIER_3 from PATIENTS join dmc on PATIENTS.ipp = dmc.CODE where dmc.NUM_DOSSIER_PAPIER is not null or dmc.NUM_DOSSIER_PAPIER_2 is not null or dmc.NUM_DOSSIER_PAPIER_3 is not null;"
I absolutely don't understand what FBExport needs. How can I export the data?
For me, the following command line works:
The problem in your original command was that you had a bare
-Q, which caused the following-Fto be interpreted as the argument of-Q, which then lead toh:\AABBCC\export.csvto be interpreted as an option, which then produced an error because it doesn't start with a-.In addition, your command also had the following problems:
-Bdefines an alternative separator character for the produced CSV. It expects a separator character orTABor\tfor a tab. So, in similar vein as the previous problem, this would cause-Dto be interpreted as an argument of-B, which then leads toh:\AABBCC\XXYYZZ.FDBto be interpreted as an option (without-).-Xis a primary option (like-S), to execute the query specified by-Q, instead of exporting (saving,-S). It doesn't accept a query text as argument, so the query text is also interpreted as an option (without-). This occurrence of-Xshould have been-Q.