Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do SQL errors not show you the error source?

Is it possible to find the line or column where an error is occurring when executing SQL code in Oracle SQL developer?

For example, imagine you are running a very simple line of code

SELECT * FROM employeesTbl WHERE active = 1

But for some reason, active is VARCHAR and someone has entered the ";!/asd02" into this field.

You will only get an ORA- error, but it does not tell you which row caused it.

Does anyone know why this is?

like image 756
RonnyKnoxville Avatar asked Oct 16 '25 16:10

RonnyKnoxville


1 Answers

The reason behind this is that in general developer support in sql, pl/sql and the like is really abysmal. One result is a really broken exception concept in pl/sql, almost useless exceptions in (oracle) sql and little hope that it is better in any rdbms.

I think the reason behind all that is that databases are persistent beasts (pun intended). Many companies and developers change from time to time there preferred main development language (C, C++, VB, Java, C#, Groovy, Scala ..). But they rarely change the database, possibly because you will still have the old databases around with no chance to migrate them.

This in turn means most DB-devs know only a single database system reasonable well, so they don't see what is possible in other systems. Therefore there is little to no pressure to make database systems any more usable for developers.

like image 192
Jens Schauder Avatar answered Oct 18 '25 08:10

Jens Schauder