Start a new topic

Position of error

[This topic is migrated from our old forums. The original author name has been removed]

Hi, When I get an SQL error, the position of the error within the SQL statement is displayed such as Position: 27, Length: 4. However, this position corresponds to the position within the current SQL statement and not the position within the SQL commander window (which is shown for the current cursor position in the command window). It would be really great if the position reported was the [line/offset offset] or [bufferoffset] in the SQL commander window instead as it would be *much* easier to find where the error occurred. If it was possible to double-click the error and the position and text was marked, that would, of course, be even better! Thanks for a great product Bengt

[This reply is migrated from our old forums. The original author name has been removed]

Re: Position of error
This would indeed be an exceptionally useful enhancement, if possible. I've lost count of the number of times I've had to copy/paste a query into SQL Server Management Studio so I could double-click to locate the error then go back to DBVisualizer to fix it.
[This reply is migrated from our old forums.]

Re: Position of error
Hi, Are you referring to the SQL Commander or the Procedure Editor? In the Procedure Editor, clicking on the icon for an error message selects the corresponding line and places the caret at the error position in 9.0, assuming that the database reports error position information in a way that makes it possible for us to read it (which is not very common). For the kind of statements that are typically run in the SQL Commander (SELECT, UPDATE, INSERT, DELETE) even fewer databases report any error positions. Clicking on the icon, selects the statement that failed, however. I agree it would be great if we could identify exactly what caused an error in all cases, but without a standard for how databases should report this, it is very hard to accomplish. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Position of error
It is a pain, however. Right now I got a "missing right parenthesis" in a 500 line SQL statement. Clicking the icon just selects the 500 rows. I have to pass the SQL along to my colleagues who use Toad or SQL Developer (we have an Oracle db) to get the line number. So obviously it can be done (even if not for all db:s). It vexes me that my tool of choice fails me in this.
[This reply is migrated from our old forums. The original author name has been removed]

Re: Position of error
I am referring to the SQL commander. In the SQL commander there is currently shown a line/offset and offset in buffer indication at the bottom of the window. I still feel it is confusing when error position does not refer to the indication you have in the buffer. Is it not only a matter of adding the offset of the start of the command to the error position? At least both Mimer SQL and SQL Server support error positions! Regards Bengt
[This reply is migrated from our old forums.]

Re: Position of error
Bengt, We have this on the todo for Mimer SQL. Regards Roger
[This reply is migrated from our old forums.]

Re: Position of error
Hi, You are right that this is doable. However, neither JDBC or the Oracle thin driver provide the position information easily. SQL Developer is Oracle and I cannot say whether they are using the OCI driver or some other trick to workaround it. We are regularly monitoring the Oracle driver and new releases in case they've added official support getting the error position through their driver. Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: Position of error
Can this be added for Postgres as well. Postgres clearly states the error position (example below), but the offset starts where the DBVis command string starts which is usually (especially in multi-statement sessions) different than the position in my editor. My current workaround is to copy and paste the statement into a clean tab with no leading newlines or spaces and re-run so that I can see the real position. Example Postgres output: 10:10:26 [SELECT - 0 row(s), 0.000 secs] [Error Code: 0, SQL State: 42P01] ERROR: relation "foo" does not exist Position: 16
[This reply is migrated from our old forums.]

Re: Position of error
Hi Shaun, I've opened a ticket for looking at this for PostgreSQL as well. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Position of error
Can this be added for DB2 for LUW ans Z/OS as well? :) Though I don't know If the driver returns it...
[This reply is migrated from our old forums.]

Re: Position of error
Hi, When we look at this for the databases mentioned in this thread, we will also see if it possible to do for other supported databases. Best Regards, Hans
[This reply is migrated from our old forums.]

Re: Position of error
Shaun, Just to inform you that we've just launched the BETA testing of the next DbVisualizer version. In this version DbVisualizer will highlight errors in the SQL for PostgreSQL, Oracle, Mimer SQL and several other databases. Give it a try. http://www.dbvis.com/download/beta/ Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: Position of error
I see SQL Server still doesn't work - any chance of looking at that sometime or are there driver restrictions that prevent it?
[This reply is migrated from our old forums.]

Re: Position of error
Hi Vince, We would really like to add support for this in SQL Server, and I'm sure we're going to get the request many times until we do, but so far we have not found a good platform independent solution. We will keep looking? Best Regards, Hans
[This reply is migrated from our old forums.]

Re: Position of error
Hi guys, Support for highlighting errors for Oracle, MySQL, PostgreSQL, Informix, JavaDB/Derby and Mimer SQL is now part of the just released DbVisualizer 9.1. Best Regards, Hans