what is the keyWord DELETING

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gauravgmbhr
    New Member
    • Feb 2007
    • 107

    what is the keyWord DELETING

    hi friends
    I have been doing testing on an existing project
    The tables in postgresQl Db has some trigger function using keyword 'DELETING'

    Code:
    IF DELETING THEN
              SOME SELECT STATEMENT
    END IF;
    can anyone please help me what is this keyword deleting
    it is creating errors on insert (coz the trigger is on insert)

    Is it really a keyword or its a mistake by the programmer who coded this
    Plz help me
  • michaelb
    Recognized Expert Contributor
    • Nov 2006
    • 534

    #2
    You did not post the entire code, but this statement alone does not look valid.

    You can review Postgres docs for more information:
    Triggers
    Create Trigger
    Trigger Procedures

    Comment

    • masdi2t
      New Member
      • Jul 2006
      • 37

      #3
      Originally posted by gauravgmbhr
      hi friends
      I have been doing testing on an existing project
      The tables in postgresQl Db has some trigger function using keyword 'DELETING'

      Code:
      IF DELETING THEN
                SOME SELECT STATEMENT
      END IF;
      can anyone please help me what is this keyword deleting
      it is creating errors on insert (coz the trigger is on insert)

      Is it really a keyword or its a mistake by the programmer who coded this
      Plz help me
      try this

      IF (TG_OP = 'INSERT') THEN
      SOME SELECT STATEMENT
      ELSEIF (TG_OP = 'UPDATE') THEN
      SOME SELECT STATEMENT
      ELSEIF (TG_OP = 'DELETE') THEN
      SOME SELECT STATEMENT
      END IF;

      Comment

      • gauravgmbhr
        New Member
        • Feb 2007
        • 107

        #4
        Originally posted by masdi2t
        try this

        IF (TG_OP = 'INSERT') THEN
        SOME SELECT STATEMENT
        ELSEIF (TG_OP = 'UPDATE') THEN
        SOME SELECT STATEMENT
        ELSEIF (TG_OP = 'DELETE') THEN
        SOME SELECT STATEMENT
        END IF;

        WELL THANX for your valuable help
        I worked it out

        Comment

        Working...