Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get SQL Plus to display more detailed errors

When installing my application, users must start SQL Plus and run an SQL script. This script contains creates many tables and many PL/SQL functions and triggers etc.

At the moment some of the functions are in the wrong order in the script and so users currently see a few "trigger created with compilation errors" type messages. I believe this is because the functions/triggers rely on other functions which means they cannot compile correctly.

What I would like to do is to find out which ones are failing and what the specific compilation error was instead of the rather vague warning I get at the moment. This way I can rearrange the functions in my install script and get no more warnings!

UPDATE

I would also like the specific errors to be logged into a file. At the moment I'm using the SPOOL command to log things, so it would be great if the errors could be 'spooled' too.

like image 758
user1578653 Avatar asked Jan 16 '14 11:01

user1578653


People also ask

How do you show errors in SQL?

To see the errors, you use SHOW ERRORS. When you specify SHOW ERRORS with no arguments, SQL*Plus shows compilation errors for the most recently created or altered stored procedure.

How do I display output in SQL Plus?

To do this we use a procedure called dbms_output. put_line to place the results in a buffer that SQL*Plus will retrieve and display. SQL*Plus must be told to retrieve data from this buffer in order to display the results. The SQL*Plus command 'set serveroutput on' causes SQL*Plus to retrieve and display the buffer.


2 Answers

You can append show errors; after creation of procedures/triggers in order to see detailed error message.

like image 93
Wernfried Domscheit Avatar answered Oct 03 '22 09:10

Wernfried Domscheit


You can add show err or select * from all_errors where name='<object_name>' order by sequence after each compilation command.

like image 40
San Avatar answered Oct 03 '22 08:10

San