.ora-code.com

Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
Debug DDL trigger

Debug DDL trigger

2005-08-23       - By Mladen Gogala
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

Wolfgang Breitling wrote:

> I could be wrong, but I am pretty sure you are not allowed to issue
> commits - or rollbacks - in a trigger. That rules out not only the
> commits of your inserts, but especially your "execute immediate
> 'create table ...'" as all DDL imply a commit.

Wolfgang, you're never wrong. If it appears that you are wrong,  it must
be the work of Satan. In this case, however,
I can strenghten tour belief with an excerpt from 9i Application
developers guide:


     Restrictions on Creating Triggers

Coding triggers requires some restrictions that are not required for
standard PL/SQL blocks. The following sections discuss these restrictions.


       Maximum Trigger Size

The size of a trigger cannot be more than 32K.


       SQL Statements Allowed in Trigger Bodies

The body of a trigger can contain DML SQL statements. It can also
contain |SELECT| statements, but they must be |SELECT|... |INTO|...
statements or the |SELECT| statement in the definition of a cursor.

DDL statements are not allowed in the body of a trigger. Also, no
transaction control statements are allowed in a trigger. |ROLLBACK|,
|COMMIT|, and |SAVEPOINT| cannot be used.For system triggers,
{|CREATE|/|ALTER|/|DROP|} |TABLE| statements and |ALTER|...|COMPILE| are
allowed.

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----



--
Mladen Gogala
Oracle DBA
Ext. 121


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
 <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Wolfgang Breitling wrote:
<blockquote cite="mid430B2639.2000905@(protected)" type="cite">I
could be wrong, but I am pretty sure you are not allowed to issue
commits - or rollbacks - in a trigger. That rules out not only the
commits of your inserts, but especially your "execute immediate 'create
table ...'" as all DDL imply a commit.
 <br>
</blockquote>
Wolfgang, you're never wrong. If it appears that you are wrong,&nbsp; it
must be the work of Satan. In this case, however,<br>
I can strenghten tour belief with an excerpt from 9i Application
developers guide:<br>
<h3 class="H2"><font color="#330099" face="Arial, Helvetica, sans-serif"
>Restrictions
on Creating Triggers</font></h3>
<!--/TOC=h2-->
<a name="1799"></a>
<p class="BP">Coding triggers requires some restrictions that are not
required for standard PL/SQL blocks. The following sections discuss
these restrictions.</p>
<a name="12438"></a>
<h4 class="SH1"><font face="Arial, Helvetica, sans-serif">Maximum
Trigger Size</font></h4>
<a name="12447"></a>
<p class="BP">The size of a trigger cannot be more than 32K.</p>
<a name="710"></a>
<h4 class="SH1"><font face="Arial, Helvetica, sans-serif">SQL
Statements Allowed in Trigger Bodies</font></h4>
<a name="712"></a>
<p class="BP">The body of a trigger can contain DML SQL statements. It
can also contain <code>SELECT</code> statements, but they must be <code>SELECT<
/code>...
<code>INTO</code>... statements or the <code>SELECT</code> statement
in the definition of a cursor.</p>
<a name="716"></a>
<p class="BP">DDL statements are not allowed in the body of a trigger.
Also, no transaction control statements are allowed in a trigger. <code
>ROLLBACK</code>,
<code>COMMIT</code>, and <code>SAVEPOINT</code> cannot be used.For
system triggers, {<code>CREATE</code>/<code>ALTER</code>/<code>DROP</code>}
<code>TABLE</code> statements and <code>ALTER</code>...<code>COMPILE</code>
are allowed.</p>
<!--AnN_AnchorNote will not be supported in future releases -->
<a name="718"></a>
<hr><br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Mladen Gogala
Oracle DBA
Ext. 121
</pre>
</body>
</html>