Home » SQL & PL/SQL » SQL & PL/SQL » displaying create trigger details (sql*plus 10.2.0, winxp)
displaying create trigger details [message #348991] Thu, 18 September 2008 08:58 Go to next message
ukdas
Messages: 32
Registered: September 2008
Location: London
Member

hi,
i have created a trigger on a table. i am trying to display the details of the trigger that was created on the basis of a table using the select command.

is it something like:

SELECT
column_name,
trigger_body
FROM
all_triggers
WHERE
table_name='table_name'
;

Regards
ukd
Re: displaying create trigger details [message #348997 is a reply to message #348991] Thu, 18 September 2008 09:15 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes, something like that.
Just use "desc all_triggers" to know the view columns.

Regards
Michel
Re: displaying create trigger details [message #349002 is a reply to message #348991] Thu, 18 September 2008 09:36 Go to previous messageGo to next message
ukdas
Messages: 32
Registered: September 2008
Location: London
Member

the following error occurred when i tried the code:

SELECT
AGENT_ID,
trigger_body
FROM
all_triggers
WHERE
table_name='INFO_ACCESS'
;



AGENT_ID,
*

ERROR at line 2:
ORA-00904: "AGENT_ID": invalid identifier








Re: displaying create trigger details [message #349003 is a reply to message #349002] Thu, 18 September 2008 09:40 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Where did you get the notion that there is a column "agent_id"?

SQL> DESC ALL_TRIGGERS
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------

 OWNER                                              VARCHAR2(30)
 TRIGGER_NAME                                       VARCHAR2(30)
 TRIGGER_TYPE                                       VARCHAR2(16)
 TRIGGERING_EVENT                                   VARCHAR2(227)
 TABLE_OWNER                                        VARCHAR2(30)
 BASE_OBJECT_TYPE                                   VARCHAR2(16)
 TABLE_NAME                                         VARCHAR2(30)
 COLUMN_NAME                                        VARCHAR2(4000)
 REFERENCING_NAMES                                  VARCHAR2(128)
 WHEN_CLAUSE                                        VARCHAR2(4000)
 STATUS                                             VARCHAR2(8)
 DESCRIPTION                                        VARCHAR2(4000)
 ACTION_TYPE                                        VARCHAR2(11)
 TRIGGER_BODY                                       LONG

SQL>
Re: displaying create trigger details [message #349025 is a reply to message #349002] Thu, 18 September 2008 10:38 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Also please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.

Regards
Michel
Previous Topic: sample data printing
Next Topic: Any simple way to achieve this
Goto Forum:
  


Current Time: Sun Dec 04 10:59:42 CST 2016

Total time taken to generate the page: 0.14800 seconds