Customize line # in messages

17 views
Skip to first unread message

Akash

unread,
Jan 9, 2023, 12:36:31 PM1/9/23
to sql-wo...@googlegroups.com
Hi Thomas,

Is there an option available to customize the line numbers in messages?

I want messages to have the editor line numbers when I run my queries. Currently it has query line numbers from my selection.



Please advise.

Thomas Kellerer

unread,
Jan 11, 2023, 4:21:27 AM1/11/23
to sql-wo...@googlegroups.com
The error message is returned by the database server and obviously can't be changed

However, SQL Workbench can put the cursor at the reported error position.
This is done by retrieving line and column information based on regular expressions from the error message.

Which DBMS are you using?
I don't recognize that error message, so this is likely not configured for your DBMS.

Thomas


Akash schrieb am 09.01.2023 um 18:36:
> Hi Thomas,
>
> Is there an option available to customize the line numbers in messages?
>
> I want messages to have the editor line numbers when I run my queries. Currently it has query line numbers from my selection.
>
>
>
> Please advise.

Akash

unread,
Jan 11, 2023, 11:54:59 AM1/11/23
to sql-wo...@googlegroups.com
Hi Thomas,

Thank you for your reply. I am using SQL workbench to connect to Snowflake.

Would you please write steps on how I can I place the cursor on the reported line #?

Thank you 


--
You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sql-workbench/f5c7a63b-2ec8-693b-7b13-96b19a3ce939%40sql-workbench.net.

Thomas Kellerer

unread,
Jan 15, 2023, 6:57:38 AM1/15/23
to sql-wo...@googlegroups.com
You need to edit workbench.settings and add the necessary regular expressions.
The location of the workbench.setttings file is shown in the about dialog.

Based on your screen shot, the following should work

workbench.db.DBID.errorinfo.regex.column=(?i)\\sposition\\s[0-9]+
workbench.db.DBID.errorinfo.regex.line=(?i)\\sline\\s[0-9]+

You have to replace the string DBID with the ID generated for snowflake.

The DBID is shown in the connection info dialog
https://www.sql-workbench.eu/manual/settings.html#dbid

Thomas


Akash schrieb am 11.01.2023 um 17:54:
> Hi Thomas,
>
> Thank you for your reply. I am using SQL workbench to connect to Snowflake.
>
> Would you please write steps on how I can I place the cursor on the reported line #?
>
> Thank you
>
>
> On Wed, Jan 11, 2023 at 4:21 AM Thomas Kellerer <google...@sql-workbench.net <mailto:google...@sql-workbench.net>> wrote:
>
> The error message is returned by the database server and obviously can't be changed
>
> However, SQL Workbench can put the cursor at the reported error position.
> This is done by retrieving line and column information based on regular expressions from the error message.
>
> Which DBMS are you using?
> I don't recognize that error message, so this is likely not configured for your DBMS.
>
> Thomas
>
>
> Akash schrieb am 09.01.2023 um 18:36:
> > Hi Thomas,
> >
> > Is there an option available to customize the line numbers in messages?
> >
> > I want messages to have the editor line numbers when I run my queries. Currently it has query line numbers from my selection.
> >
> >
> >
> > Please advise.
>
> --
> You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <mailto:sql-workbench%2Bunsu...@googlegroups.com>.
> --
> You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <mailto:sql-workbenc...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sql-workbench/CAGUQpGEviOEaoX8CsdN7Uj8K-trDaLK9vc%3DeMf6tt26GoROX3Q%40mail.gmail.com <https://groups.google.com/d/msgid/sql-workbench/CAGUQpGEviOEaoX8CsdN7Uj8K-trDaLK9vc%3DeMf6tt26GoROX3Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Akash Nath

unread,
Jan 29, 2023, 11:51:33 PM1/29/23
to SQL Workbench/J - DBMS independent SQL tool
Thank you Thomas.

I am sure Workbench will evolve but this tip is helpful. The error message prints the line where there was an error:

An error occurred when executing the SQL command:
SELECT IE.EXTERNAL_ACTIVITY_SOURCE,
       IE.RECIPIENT,...

SQL compilation error:
syntax error line 9 at position 24 unexpected '.'.

       IE.CUSTOMER_ID IE.BATCH_NUMBER
                       ^
1 statement failed.

Execution time: 0.12s
(2023-01-29 23:46:26.126)

Reply all
Reply to author
Forward
0 new messages