Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Location
    The Netherlands
    Posts
    149

    Unanswered: Comment On Trigger?

    Hello,

    I want to add comment to a trigger. In sybase I can say:
    COMMENT ON TRIGGER Owner.TableName.Triggername IS 'Comment';

    Can I do such a thing in Oracle?

    greetz Coen Dunnink

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Oracle Documentation says that you can associate a comment with a table, view, materialized view, or column using the COMMENT command. Comments associated with schema objects are stored in the data dictionary. Personally, I've never heard of comments on triggers.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    How about altering the trigger to add an actual comment in the code. It will function the exact same way, but anyone viewing the source will see the comment.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    do what Bill said. Here is an example of how I comment a trigger.
    nothing fancy but it works like a charm:
    PHP Code:
    CREATE OR REPLACE TRIGGER CHECK_BLNG_PRD_END_DT_TRG
        BEFORE INSERT 
    OR UPDATE ON BILLING_PERIOD
        
    FOR EACH ROW
        WHEN 
    (NEW.end_dt < NEW.start_dt)
    DECLARE
    /*------------------------------------------------------*/
    /* This trigger verifies the billing period end date is */
    /* greater than the start date of the period            */
    /*------------------------------------------------------*/
    BEGIN

    RAISE_APPLICATION_ERROR 
    (-20002'invalid end date');

    END;

    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •