Trigger error/Mistake
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Trigger error/Mistake

  1. #1
    Join Date
    Jan 2004
    Posts
    2

    Trigger error/Mistake

    Hi guys,
    I am in desperate need of your help.

    The customer recently wanted to synchronized the "decision_date" from table BC_info and decided in DOCS.
    (BC_info primary keys ca_year, ca_number) so in the BC_INFO trigger(insert or update or delete) i did the following.

    if nvl(:new.DECISION_DATE,null_date) != nvl(ld.DECISION_DATE,null_date) then

    begin
    update docs
    set decided = :new.decision_date
    where ca_year = ca_year (Instead of :new.ca_year )
    and ca_number = ca_number (Instead of :new.ca_number
    and type in ('ADP');
    exception when others then
    null;
    end;
    end if;

    Due to which all docs with type('ADP') are updated with wrong date, i need to correct this mistake so they are synchronized with same date.
    But now i think i need to write some code to see if there is a decision date and then loop and update only 'ADP' documents with the new ones. So please help me it's very critical for me to fix it by monday.
    Please Help me out, it 's very critical, i would provide more info if required and would be very very grateful.

    thanks
    sud

  2. #2
    Join Date
    Aug 2001
    Location
    chennai,bangalore
    Posts
    840
    Hi,
    Do you mean to say, the decided column in DOCS table needs to be sync with decision_date from bc_info

    regards
    anandkl
    anandkl

Posting Permissions

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


Click Here to Expand Forum to Full Width