Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to find PL/SQL code

RE: How to find PL/SQL code

From: Lucia DeMeester <ldemeester_at_nm2.com>
Date: Thu, 10 Aug 2000 14:07:10 -0700
Message-Id: <10585.114303@fatcity.com>


I don't know whether there is a quick way to get the whole trigger script from the database. I think you need to go through several steps to recreate the trigger. Here is what I did:

  1. first get the trigger_body from sys.dba_triggers (before you query the trigger_body you need to set long 2000)
  2. select the rest of the columns such as trigger_type, triggering_event, table_name, when_clause etc. From these column information then you can sandwich the trigger body with the trigger_type etc.

Hope this help.
Lucia

-----Original Message-----
From: geeta.iyer_at_sprintparanet.com [mailto:geeta.iyer_at_sprintparanet.com] Sent: Thursday, August 10, 2000 12:44 PM To: ORACLE-L_at_fatcity.com
Subject: RE: How to find PL/SQL code

y.com [mailto:root_at_fatcity.com]On Behalf Of Jeff Wiegand   Sent: Thursday, August 10, 2000 9:45 AM   To: Multiple recipients of list ORACLE-L   Subject: How to find PL/SQL code

  Hello

  We have several triggers that have been modified. Unfortunately, the modifications weren't saved, but they are reflected in the database. How can
I get Oracle to output the code of the triggers. I select on user_triggers, or all_triggers, using trigger_name and trigger_body columns, but only part of the code is outputted to the screen. How can I get all of it?

  Thanks for your help.

  Jeff

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>How to find PL/SQL code</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2920.0" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=019022518-10082000>Jeff,</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=019022518-10082000></SPAN></FONT>&nbsp;</DIV>
<DIV><SPAN class=019022518-10082000>
<P><FONT color=#0000ff face=Arial size=2>set heading off</FONT></P>
<P><FONT color=#0000ff face=Arial size=2>set feedback off</FONT></P>
<P><FONT color=#0000ff face=Arial size=2>set linesize 100</FONT></P>
<P><FONT color=#0000ff face=Arial size=2>set pagesize 0</FONT></P>
<P><FONT color=#0000ff face=Arial size=2>break on name skip 10</FONT></P>
<P><FONT color=#0000ff face=Arial size=2>spool
exportStoredProceduresOnly.txt</FONT></P>
<P><FONT color=#0000ff face=Arial size=2>select decode (line,1,'create or
replace '||text,text)</FONT></P>
<P><FONT color=#0000ff face=Arial size=2>from sys.dba_source</FONT></P>
<P><FONT color=#0000ff face=Arial size=2>where
owner='&amp;Owner'</FONT></P>
<P><FONT color=#0000ff face=Arial size=2>order by
owner,name,type,line;</FONT></P>
<P><FONT color=#0000ff face=Arial size=2>spool off</FONT></P>
<P>&nbsp;</P>
<P><FONT color=#0000ff face=Arial size=2><SPAN
class=019022518-10082000>Hope
this helps..</SPAN></FONT></P>
<P><FONT color=#0000ff face=Arial size=2><SPAN
class=019022518-10082000></SPAN></FONT>&nbsp;</P><FONT color=#0000ff face=Arial
size=2><SPAN class=019022518-10082000>
<P><FONT size=2>Geeta Iyer<BR>Sprint Enterprise Network
Services<BR>Work:&nbsp;
(303)220-4788<BR>Pager:&nbsp; 888-632-2718<BR>E-Mail: Geeta.Iyer_at_SprintParanet.com<BR></FONT></P></SPAN></FONT></SPAN></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">

  <DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma   size=2>-----Original Message-----<BR><B>From:</B> root_at_fatcity.com   [mailto:root_at_fatcity.com]<B>On Behalf Of </B>Jeff Wiegand<BR><B>Sent:</B>
  Thursday, August 10, 2000 9:45 AM<BR><B>To:</B> Multiple recipients of list
  ORACLE-L<BR><B>Subject:</B> How to find PL/SQL code<BR><BR></DIV></FONT>   <P><FONT size=2>Hello</FONT> </P>
  <P><FONT size=2>We have several triggers that have been modified.   Unfortunately, the modifications weren't saved, but they are reflected in the
  database. How can I get Oracle to output the code of the triggers. I select on
  user_triggers, or all_triggers, using trigger_name and trigger_body columns,
  but only part of the code is outputted to the screen. How can I get all of

  it?</FONT></P>
  <P><FONT size=2>Thanks for your help.</FONT> </P>
  <P><FONT size=2>Jeff</FONT> </P></BLOCKQUOTE></BODY></HTML>



Received on Thu Aug 10 2000 - 16:07:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US