> ora_dict_obj_type is a system defined event attribute for DDL triggers, escentially Oracle-defined variables.
Duh. :( Should have read it closer! Brain on autopilot read "drop" as "delete".
Haven't worked with this type of trigger.
I would suggest turning the when clause into an if statement in the trigger body, and, for debugging purposes, add an else branch that does something you can also trace. Maybe it doesn't "set" the values until the trigger fires. If nothing else, you can use the else branch to find out what values are in those variables!
I need this to be a DDL trigger, not a DML trigger, as I want to capture the table and its contents before its dropped. When created, it could be done via CTAS or just CREATE, followed by various DML statements. To capture its final contents I'd be easiest for me to copy it right before it gets dropped. I guess I could generate a materialized view on it when its created, so that all content would be automatically applied to the copy, but I thought this would be easier.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = "urn:schemas-microsoft-com:vml" xmlns:o = "urn:schemas-microsoft-com:office:office" xmlns:w = "urn:schemas-microsoft-com:office:word" xmlns:x = "urn:schemas-microsoft-com:office:excel"><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> <TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1515" name=GENERATOR><!--[if !mso]> <STYLE>v\:* { BEHAVIOR: url(#default#VML) } o\:* { BEHAVIOR: url(#default#VML) } w\:* { BEHAVIOR: url(#default#VML) } shape { BEHAVIOR: url(#default#VML) } </STYLE> <![endif]--> <STYLE>@(protected) { font-family: Tahoma; } @(protected) Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; } P.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } LI.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } DIV.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } P.MsoBodyText { FONT-SIZE: 12pt; MARGIN: 0in 0in 6pt; FONT-FAMILY: "Times New Roman" } LI.MsoBodyText { FONT-SIZE: 12pt; MARGIN: 0in 0in 6pt; FONT-FAMILY: "Times New Roman" } DIV.MsoBodyText { FONT-SIZE: 12pt; MARGIN: 0in 0in 6pt; FONT-FAMILY: "Times New Roman" } A:link { COLOR: blue; TEXT-DECORATION: underline } SPAN.MsoHyperlink { COLOR: blue; TEXT-DECORATION: underline } A:visited { COLOR: #606420; TEXT-DECORATION: underline } SPAN.MsoHyperlinkFollowed { COLOR: #606420; TEXT-DECORATION: underline } P.StyleBodyTextItalic { FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt 0.25in; FONT-STYLE: italic; FONT-FAMILY: "Times New Roman" } LI.StyleBodyTextItalic { FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt 0.25in; FONT-STYLE: italic; FONT-FAMILY: "Times New Roman" } DIV.StyleBodyTextItalic { FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt 0.25in; FONT-STYLE: italic; FONT-FAMILY: "Times New Roman" } P.stylebodytextitalic0 { FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt 0.25in; FONT-STYLE: italic; FONT-FAMILY: "Times New Roman" } LI.stylebodytextitalic0 { FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt 0.25in; FONT-STYLE: italic; FONT-FAMILY: "Times New Roman" } DIV.stylebodytextitalic0 { FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt 0.25in; FONT-STYLE: italic; FONT-FAMILY: "Times New Roman" } SPAN.EmailStyle20 { COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal } SPAN.EmailStyle21 { COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply } DIV.Section1 { page: Section1 } </STYLE> </HEAD> <BODY lang=EN-US vLink=#606420 link=blue> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV><FONT face=Tahoma> <DIV><BR></FONT><FONT color=navy><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN class=950503213-23082005><FONT color=#0000ff>> </FONT></SPAN>ora_dict_obj_type is a system defined event attribute for DDL triggers, escentially Oracle-defined variables.<SPAN class=950503213-23082005> <FONT color=#0000ff> </FONT></SPAN></SPAN></FONT></DIV> <DIV><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN class=950503213-23082005></SPAN><FONT color=#0000ff><SPAN class=950503213-23082005> </SPAN></FONT></SPAN></DIV> <DIV><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT color=#0000ff><SPAN class=950503213-23082005>Duh. :( </SPAN></FONT></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT color=#0000ff><SPAN class=950503213-23082005>Should have read it closer! Brain on autopilot read "drop" as "delete".</SPAN></FONT></SPAN></DIV> <DIV><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT color=#0000ff><SPAN class=950503213-23082005></SPAN></FONT></SPAN> </DIV> <DIV><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT color=#0000ff><SPAN class=950503213-23082005>Haven't worked with this type of trigger.</SPAN></FONT></SPAN></DIV> <DIV><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT color=#0000ff><SPAN class=950503213-23082005></SPAN></FONT></SPAN> </DIV> <DIV><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT color=#0000ff><SPAN class=950503213-23082005>I would suggest turning the when clause into an if statement in the trigger body, and, for debugging purposes, add an else branch that does something you can also trace.</SPAN></FONT></SPAN></DIV> <DIV><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT color=#0000ff><SPAN class=950503213-23082005>Maybe it doesn't "set" the values until the trigger fires. If nothing else, you can use the else branch to find out what values are in those variables!</SPAN></FONT></SPAN></DIV> <BLOCKQUOTE dir=ltr style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px"> <DIV class=Section1> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p>< /SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I need this to be a DDL trigger, not a DML trigger, as I want to capture the table and its contents before its dropped. When created, it could be done via CTAS or just CREATE, followed by various DML statements. To capture its final contents I'd be easiest for me to copy it right before it gets dropped. I guess I could generate a materialized view on it when its created, so that all content would be automatically applied to the copy, but I thought this would be easier.<I><SPAN style="FONT-STYLE: italic"><o:p></o:p></SPAN></I></SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p>< /SPAN></FONT></P> <DIV> <P class=MsoNormal><FONT face=Arial color=#0000ff size=2></FONT> </P></DIV></DIV></BLOCKQUOTE></BODY></HTML>