trigger creation via *.trg versus via *.pdc

Bernhard S

Member³
I have the following issues regarding triggers. My database development has to finally be delivered for test and prod DB migrations and is applied there via SQL*Plus. To find out any problems with the currently developped migration I have an automatically run nightly migration, also done via SQL*Plus.
Currently all my trigger changes are done via PL/SQL Developer (PSD) "Command Window" (*.pdc). In order to see any problems with a trigger change in my nightly migration I add after every

SQL:
create or replace trigger ...

the SQL*Plus command

SQL:
show errors

because otherwise in case of any problem I would only get a:

Code:
Warning: Trigger created with compilation errors.

without any indication where there is a problem with the trigger.

I now thought about changing my trigger migrations to done in a PSD "Programm Window - Trigger" (*.trg), because I could just add several triggers in one window, but still visually separated then and still only have to maintain and deliver one file for all trigger migrations. However if I add the SQL*PLUS command again after the trigger code there, and I execute the code in PSD I get a:

Code:
PLS-00103: Encountered the symbol "SHOW"

I could of course do without that, but then I never see any error codes in my nightly migration, which of course I want to avoid as well.
So is there any way to work around these limitations? What approach would you recommend?
 
I found a workaround now. The problem is that in the PSD "Programm Window - Trigger" (*.trg) "show errors" after my trigger code gets added in the file before the slash (/), which causes the PLS-00103 error. If however I add the "show errors" in front of the next trigger in the same PSD window, it compiles fine in PSD and at the same time potential error details are shown via SQL*PLUS in my nightly migration. I cover the final trigger in the window then by adding a show errors in the calling script PSD "Command Window".
It would be smoother and more intuitive though if there was a preference setting for PSD "Programm Window - Trigger" (*.trg) to automatically add a "show errors" just for SQL*PLUS execution of the file, which gets ignored in PSD window.
I guess it would also help to have the slash (/) added right after the "END;" of the actual trigger code and in that way allowing SQL*PLUS commands to be added the trigger code, without causing any errors in execution.
 
Back
Top