debugging - Is there a better way to debug SQL? -


I have worked with SQL for many years, mainly MySQL / PhpMyAdmin, but Oracle / ISKPlplus and PL / SQL Hall In the same way I have programmed in PHP, Java, Action Script and more. I realize that SQL is not a compulsory programming language like others - but why do the error messages in SQL look so less specific? In other environments, I directly tell the root cause of the problem. More often than not, MySQL returns an error like "error strains where u.id = ..." and prints the entire query. It is even more difficult with stored procedures, where debugging can be a complete nightmare.

Am I missing from a magic device / language / plugin / setting that gives better error reporting or do we get stuck with it? I want a debugger or language that gives me the same kind of control that the eclipse gives me when setting breakpoints and leaving the code is it possible?

I think the answer lies in the fact that SQL is a set-based language attached to some procedural things As the designers were considering set-based terms, they did not think that the common type of debugging of other languages ​​is important. However, I think some of this is changing. You can set breakpoints in SQL Server 2008. I did not really use it because you should have SQL Server 2008 database before it will work and most of ours are still SQL Server 2000. But it is available and it lets you move things through it. You are still having problems when your selection statement is 150 lines long and knows that the syntax is not correct, but it can not tell exactly where it is an order

Personally when I Writing a long processive SP, I create a test mode in which I get the results of the things I do, the value of the important variable at the specific points, the obstacles that I Know that the steps have been completed and when the whole thing rolling back, in this way I can see what would have happened if it had run for the real, but I did not harm any data in the database, if I got wrong I find this very useful. This can increase the size of your proc, although I have a template that I need to use in that structure, so it does not really take me too long especially since I never add a single join to any To update or delete a property, the pre-linked selection can not be tested to ensure that I have the records that I need.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -