# Script runner aborts after compile error

**URL:** <https://forums.toadworld.com/t/script-runner-aborts-after-compile-error/39826>\
**Category:** Toad for Oracle - Beta\
**Created:** [August 7, 2017, 11:32pm UTC](https://forums.toadworld.com/t/script-runner-aborts-after-compile-error/39826 "2017-08-07T23:32:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kornelis.abe](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kornelis.abe](https://forums.toadworld.com/u/kornelis.abe)\
**Post date:** [August 7, 2017, 11:32pm UTC](https://forums.toadworld.com/t/script-runner-aborts-after-compile-error/39826/1 "2017-08-07T23:32:13Z")

</div>

All,

This relates to Toad for Oracle Beta 12.12.0.8.

I’m running a script (using F5) that defines a table or a materialized view of the table, depending on the system.

After defining the object, it invokes three scripts to define triggers,  
and then it invokes a script to set up the initial content (if it is a table, rather than an MV).  
Like this:  
– Triggers first: insert statement in \_data.sql depends on insert trigger!  
@…\Triggers\database\_tbl\_rbi.trg  
@…\Triggers\database\_tbl\_rbu.trg  
@…\Triggers\database\_tbl\_rbd.trg  
@…\Setup\_data\database\_tbl\_data.sql

Unfortunately, the third trigger does not compile.  
But that should not cause the script from terminating;  
and certainly not without reporting why it is quitting.

Here’s the final piece of the script output window:  
Trigger created.  
PL/SQL procedure successfully completed.  
Trigger created.  
PL/SQL procedure successfully completed.  
Warning: compiled but with compilation errors

I’m not worried about the error in the trigger.  
What bothers me is that the script execution is terminated  
without any message.

So I spooled SQL to see if that yields any clue.  
Please see below for content.

I have lots of nested scripts.  
It’s really an issue if I cannot depend on the scripts  
being run completely ☹

If you need any additional info, please let me know!

# Abe Kornelis.

Spooled output:

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:46.620  
BEGIN SYS.DBMS\_OUTPUT.ENABLE(buffer\_size =\> NULL); END;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:46.672  
begin dbms\_output.enable(0); end;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:46.685  
select PARAMETER,VALUE from nls\_session\_parameters where PARAMETER in(‘NLS\_NUMERIC\_CHARACTERS’,‘NLS\_DATE\_FORMAT’,‘NLS\_CURRENCY’);

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:46.696  
select to\_char(9,‘9C’) from dual;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:46.711  
begin  
utl\_krg.install.drop\_table(p\_schema =\> ‘UTL\_KRG’  
, p\_table =\> ‘database\_tbl’  
, p\_save\_data =\> ‘N’  
, p\_drop\_ref\_constraints =\> ‘Y’  
);  
exception  
when others  
then  
utl\_krg.msg\_log.standard\_exception\_handler(p\_schema =\> ‘utl\_krg’  
, p\_routine =\> ‘database\_tbl’  
, p\_msg\_code =\> sqlcode  
, p\_local\_msg\_prefix =\> ‘UTL’  
, p\_message =\> sqlerrm  
);  
end;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:46.857  
begin dbms\_output.get\_line(:ln,:st); end;  
:ln(LONG,OUT)=  
:st(INTEGER,OUT)=

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:46.882  
create table utl\_krg.database\_tbl(database\_name varchar2(20 char) not null /\* Name of database as we use it _/  
, seq numeric(3, 0) not null /_ Meaningless sequence number _/  
, internal\_name varchar2(50 char) not null /_ Name of database as defined to itself _/  
, database\_descr varchar2(80 char) not null /_ Description _/  
, otap\_levels varchar2(8 char) not null /_ O=dev, T=tst, A=Accept, P=Prod, S=Support, E=Engineering _/  
, utl\_krg\_start date /_ date UTL\_KRG schema was installed. Null when UTL\_KRG not installed _/  
, utl\_krg\_end date /_ date UTL\_KRG schema was uninstalled. Null when UTL\_KRG not uninstalled _/  
, msg\_repository varchar2(8 char) /_ DB\_name of central database when utl\_krg\_installed=Y; null otherwise _/  
, standard\_repository varchar2(1 char) not null /_ Y/N repository must match the TO\_REPPRD target DB _/  
, start\_date date not null /_ First day compno is valid _/  
, end\_date date /_ Last day this compno is valid \*/  
, change\_date date not null  
, change\_user varchar2(22 char) not null  
, comments varchar2(1024 char)  
);

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:46.925  
comment on table utl\_krg.database\_tbl is ’ /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
NAME: database\_tbl  
REF: Quality Improvement Program

PURPOSE: We want a single location to store database-related data

REVISIONS:  
Ver Date Author Description

* * *

1.0 16-Mar-15 Abe Kornelis Created this definition  
1.1 07-Sep-15 Abe Kornelis ORADEV-176 Create common parameter table

NOTES:

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:46.968  
declare  
l\_row\_count pls\_integer;  
begin  
if upper(substr(ora\_database\_name, 1, 3)) \<\> ‘REP’  
then  
utl\_krg.install.drop\_table(p\_schema =\> ‘UTL\_KRG’  
, p\_table =\> ‘database\_TBL’  
, p\_save\_data =\> ‘N’  
, p\_drop\_ref\_constraints =\> ‘N’  
);

execute immediate ‘select count(\*)  
from all\_tab\_cols@rep\_utl\_krg  
where owner = ‘‘UTL\_KRG’’  
and table\_name = ‘‘DATABASE\_TBL’’  
and column\_name = ‘‘STANDARD\_REPOSITORY’’’ into l\_row\_count;

if l\_row\_count = 1  
then – column standard\_repository is defined on target system  
execute immediate ‘create materialized view utl\_krg.database\_tbl  
build immediate  
refresh complete on demand  
as  
select \*  
from utl\_krg.database\_tbl@rep\_utl\_krg’;  
else  
execute immediate ‘create materialized view utl\_krg.database\_tbl  
build immediate  
refresh complete on demand  
as  
select db.\*  
, ‘‘N’’ as standard\_repository  
from utl\_krg.database\_tbl@rep\_utl\_krg db’;  
end if;  
end if;  
exception  
when others  
then  
utl\_krg.msg\_log.standard\_exception\_handler(p\_schema =\> ‘utl\_krg’  
, p\_routine =\> ‘database\_tbl’  
, p\_msg\_code =\> sqlcode  
, p\_local\_msg\_prefix =\> ‘UTL’  
, p\_message =\> sqlerrm  
);  
end;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.399  
begin dbms\_output.get\_line(:ln,:st); end;  
:ln(LONG,OUT)=  
:st(INTEGER,OUT)=

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.422  
comment on column utl\_krg.database\_tbl.database\_name is ‘Name of database as we know it’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.451  
comment on column utl\_krg.database\_tbl.seq is ‘Meaningless sequence number to create unique keys’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.480  
comment on column utl\_krg.database\_tbl.internal\_name is ‘Internal name the database has defined for itself’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.518  
comment on column utl\_krg.database\_tbl.database\_descr is ‘Full description’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.547  
comment on column utl\_krg.database\_tbl.otap\_levels is  
‘Intended usage: O=development, T=test, A=Acceptance, P=Production, S=Support, E=Engineering’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.576  
comment on column utl\_krg.database\_tbl.utl\_krg\_start is ‘Date utl\_krg schema was installed; null when utl\_krg not (yet) installed’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.615  
comment on column utl\_krg.database\_tbl.utl\_krg\_end is ‘Date utl\_krg schema was uninstalled’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.648  
comment on column utl\_krg.database\_tbl.msg\_repository is ‘Database where propagated messages are stored’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.682  
comment on column utl\_krg.database\_tbl.standard\_repository is ‘Y/N repository must match the TO\_REPPRD target DB’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.714  
comment on column utl\_krg.database\_tbl.start\_date is ‘First day this database is valid’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.748  
comment on column utl\_krg.database\_tbl.end\_date is ‘Last day this database is valid’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.782  
comment on column utl\_krg.database\_tbl.change\_date is ‘Timestamp of last update’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.816  
comment on column utl\_krg.database\_tbl.change\_user is ‘Initiator of last update’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.845  
comment on column utl\_krg.database\_tbl.comments is ‘Comment field’;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.891  
begin  
if upper(substr(ora\_database\_name, 1, 3)) = ‘REP’  
then  
execute immediate ‘create unique index utl\_krg.database\_tbl\_pk  
on utl\_krg.database\_tbl(database\_name, seq)’;

execute immediate ‘alter table utl\_krg.database\_tbl add constraint database\_tbl\_pk  
primary key(database\_name, seq)’;

utl\_krg.install.declare\_table(p\_schema =\> ‘utl\_krg’, p\_table =\> ‘database\_tbl’);  
else  
utl\_krg.install.declare\_materialized\_view(p\_schema =\> ‘utl\_krg’, p\_materialized\_view =\> ‘database\_tbl’);  
end if;  
exception  
when others  
then  
utl\_krg.msg\_log.standard\_exception\_handler(p\_schema =\> ‘utl\_krg’  
, p\_routine =\> ‘database\_tbl’  
, p\_msg\_code =\> sqlcode  
, p\_local\_msg\_prefix =\> ‘UTL’  
, p\_message =\> sqlerrm  
);  
end;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.910  
begin dbms\_output.get\_line(:ln,:st); end;  
:ln(LONG,OUT)=  
:st(INTEGER,OUT)=

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.933  
alter table database\_tbl  
add constraint database\_tbl\_fk\_otap\_levels foreign key(otap\_levels) references utl\_krg.otap\_levels(otap\_level) enable validate;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:47.968  
alter table utl\_krg.database\_tbl  
add constraint database\_tbl\_dates check  
( ( start\_date is null  
and end\_date is null)  
or ( start\_date is not null  
and ( end\_date is null  
or end\_date \> start\_date)));

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:48.135  
alter table utl\_krg.database\_tbl  
add constraint database\_tbl\_utl\_dates check  
( ( utl\_krg\_start is null  
and utl\_krg\_end is null)  
or ( utl\_krg\_start is not null  
and ( utl\_krg\_end is null  
or utl\_krg\_end \> utl\_krg\_start)));

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:48.168  
alter table utl\_krg.database\_tbl  
add constraint database\_tbl\_repository check  
( ( utl\_krg\_start is null  
and msg\_repository is null)  
or ( utl\_krg\_start is not null  
and msg\_repository is not null)  
or ( utl\_krg\_start is not null  
and utl\_krg\_end is not null  
and msg\_repository is not null));

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:48.206  
alter table utl\_krg.database\_tbl  
add constraint database\_tbl\_std\_repository check(standard\_repository in (‘Y’, ‘N’));

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:48.238  
grant select on utl\_krg.database\_tbl to public;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:48.294  
create or replace trigger utl\_krg.database\_tbl\_rbi  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
NAME: database\_tbl\_rbi  
REF: NEPS

PURPOSE: Validate data before inserting a row into the database\_tbl table

INPUT:  
OUTPUT:

REVISIONS:  
Ver Date Author Description  
— --------- ----------- ------------------------------------  
1.0 16-Mrt-15 Abe Kornelis Created this definition

NOTES:  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
before insert  
on utl\_krg.database\_tbl  
for each row  
declare  
l\_my\_schema constant varchar2(40) := ‘utl\_krg’;  
l\_my\_routine constant varchar2(40) := ‘database\_tbl\_rbi’;

l\_message varchar2(4000);  
l\_aantal pls\_integer;  
begin  
:new.change\_date := current\_date;

select env.osuser  
into :new.change\_user  
from utl\_krg.current\_env\_vw env;  
end database\_tbl\_rbi;

* * *

– Session: UTL\_KRG@WMT920  
– Timestamp: 08:20:48.322  
begin  
if upper(substr(ora\_database\_name, 1, 3)) \<\> ‘REP’  
then  
utl\_krg.install.drop\_trigger(p\_schema =\> ‘UTL\_KRG’, p\_trigger =\> ‘database\_TBL\_RBI’);  
utl\_krg.msg\_log.log\_info\_msg(p\_caller =\> ‘utl\_krg.database\_tbl\_rbi’  
, p\_message =\> 'Trigger UTL\_KRG.database\_tbl\_rbi is not needed on ’ || ora\_database\_name  
);  
else  
utl\_krg.install.declare\_trigger(p\_schema =\> ‘UTL\_KRG’, p\_trigger =\> ‘database\_tbl\_rbi’);  
utl\_krg.msg\_log.log\_info\_msg(p\_caller =\> ‘utl\_krg.database\_tbl\_rbi’  
, p\_message =\> ‘Trigger UTL\_KRG.database\_tbl\_rbi has been (re-)created’  
);  
end if;  
exception  
when others  
then  
utl\_krg.msg\_log.standard\_exception\_handler(p\_schema =\> ‘utl\_krg’  
, p\_routine =\> ‘database\_tbl\_rbi’  
, p\_msg\_code =\> sqlcode  
, p\_local\_msg\_prefix =\> ‘UTL’  
&

---

<div class="post-metadata">

**Author:** ![damir.vadas\_250](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/damir.vadas_250/32/37_2.png) [@damir.vadas\_250](https://forums.toadworld.com/u/damir.vadas_250)\
**Post date:** [August 8, 2017, 7:23am UTC](https://forums.toadworld.com/t/script-runner-aborts-after-compile-error/39826/2 "2017-08-08T07:23:58Z")

</div>

I do not know if this has influence in your case:

![scripts.png](https://global.discourse-cdn.com/quest/original/2X/3/3ff950b2dd8fd771c130fbe0639a9535f28e8a2c.png)

---

<div class="post-metadata">

**Author:** ![droeschley\_109](https://avatars.discourse-cdn.com/v4/letter/d/9f8e36/32.png) [@droeschley\_109](https://forums.toadworld.com/u/droeschley_109)\
**Post date:** [August 8, 2017, 1:49pm UTC](https://forums.toadworld.com/t/script-runner-aborts-after-compile-error/39826/3 "2017-08-08T13:49:29Z")

</div>

I have a similar issue. When running a script from the Editor, when an error is thrown I get the popup, but choosing Ignore or Ignore This Error both halt the execution of the script. If I choose Ignore All, the script continues to the end.

I also have the same exact problem as above where as soon as the scripts reports ‘Warning: compiled but with compilation errors’, it stops

---

<div class="post-metadata">

**Author:** ![jbowman](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/jbowman/32/22_2.png) [@jbowman](https://forums.toadworld.com/u/jbowman)\
**Post date:** [August 8, 2017, 4:45pm UTC](https://forums.toadworld.com/t/script-runner-aborts-after-compile-error/39826/4 "2017-08-08T16:45:32Z")

</div>

Hi Abe,

It looks like a fix to a different issue broke this one. It’s been fixed for the next beta on Thursday.

Sorry about that!

-John

---

<div class="post-metadata">

**Author:** ![kornelis.abe](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kornelis.abe](https://forums.toadworld.com/u/kornelis.abe)\
**Post date:** [August 8, 2017, 10:42pm UTC](https://forums.toadworld.com/t/script-runner-aborts-after-compile-error/39826/5 "2017-08-08T22:42:00Z")

</div>

John,

No problem - I’m glad it’ll be fixed soon.  
For the time being, I’ll use 12.11 to run my scripts 🙂

# Thanks for the quick fix, Abe

---

<div class="post-metadata">

**Author:** ![kornelis.abe](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kornelis.abe](https://forums.toadworld.com/u/kornelis.abe)\
**Post date:** [August 8, 2017, 10:44pm UTC](https://forums.toadworld.com/t/script-runner-aborts-after-compile-error/39826/6 "2017-08-08T22:44:26Z")

</div>

Damir,

thanks for the suggestion. Good to know it’s possible to have Toad auto-ignore specified exceptions.

On my environment, the feature is turned off altogether, so should not have an impact.

# Thanks anyway! Abe
