wbexport prepending the output path with the application directory

25 views
Skip to first unread message

roger_...@hotmail.com

unread,
Dec 11, 2021, 1:41:06 AM12/11/21
to SQL Workbench/J - DBMS independent SQL tool
I installed SQL Workbench on a co-workers PC running Windows 11.

He tried to run a query I gave him that used wbexport.  The output file was like:
"c:\MyFolder\Some Output For Test.xlsx"

It errored out saying it could not locate folder:
C:\SqlWorkbench  "c:\MyFolder\Some Output For Test.xlsx"

It seems to be prepending the application folder.  Any ideas?  I can't find any configuration parameter and I've never had that problem on Win 7 or Win 10.

Thanks.

Thomas Kellerer

unread,
Dec 13, 2021, 8:51:28 AM12/13/21
to sql-wo...@googlegroups.com
If you don't specify an absolute path when using WbExport, it uses a relative path depending on the "current directory" of the appliation (which in turn depends on how exactly you started it).

What was the full WbExport command you used?

roger_...@hotmail.com

unread,
Dec 14, 2021, 8:40:39 PM12/14/21
to SQL Workbench/J - DBMS independent SQL tool
Thanks for the reply, Thomas. I assumed the relative path logic was as you mentioned but the wbexport has an absolute path.

Interestingly, based on the message, I'm wondering if there is some delimiter issue as the message seems to include the entire SQL.  

This works fine on my machine - Win10, Workbench build 127.
His is Win11, Workbench build 128.

Here's a partial copy of the statements...

wbexport -type=xlsx
-file="c:\tmp\Hawaii Invoice Summary - Special Request - 2021-10-20.xlsx"

 SELECT cono65                                      /* Company              */
       , type65 AS CONO                            /* Invoice Type         */
       , invn65 AS INVN                            /* Invoice #            */
< more sql >

Error...
The outputfile could not be created: C:\SQLworkBench\"c:\tmp\Hawaii Invoice Summary - Special Request - 2021-10-20.xlsx"   SELECT cono65                                              , type65 AS CONO                                    , invn65 AS INVN                                    , cymdtodate(dtin65) AS INVDATE
<rest of the SQL>

roger_...@hotmail.com

unread,
Dec 16, 2021, 5:32:41 PM12/16/21
to SQL Workbench/J - DBMS independent SQL tool
I believe I found it.  Just installed Build 128 for another co-worker but on Win 10 and she had the same issue. Kind of eliminated my thinking it was Win11 induced.

What we found was if we terminated the wbexport with a semi-colon, it worked OK.  
As I expected, there was some sort of delimiter non-recognition.

wbexport -type=xlsx
-file="c:\tmp\Hawaii Invoice Summary - Special Request - 2021-10-20.xlsx";   <--  Added semi-colon

On Build127, the semi-colon is not needed - in fact, I never use it.
Don't know if it was a bug introduced in this build or if it is now working correctly.

Anyway, I have a workaround but wanted to let you know more on the issue.

Thanks for a great product!!

Thomas Kellerer

unread,
Dec 17, 2021, 3:01:17 AM12/17/21
to sql-wo...@googlegroups.com
Hmm, SQL Workbench has required a semicolon to terminate a SQL statement since the beginning. This is not something new.

The only thing that changed between 127 and 128 is the mixed use of the alternate delimiter.
But this would only be relevant if you do use the alternate delimiter in the script that contains WbExport

But I'm glad you figured it out.

Thomas
Reply all
Reply to author
Forward
0 new messages