How to create my first trigger

  • EMERGENCY FOR TODAY!! THANK YOU EMERGENCY FOR TODAY

    Good morning. I need to create a trigger (my first one!) but so far I have no luck making it to work.

    What I need is the following:

    I have a table (table 1) with a few fields the essential ones are: Record_Number (assigned by an outside source, let's say Parent company), accountnumber1, accountnumber2, record_id_Search1 and record_Search (last six digits of the account numbers). All fields are char (19), but the original values have 7 characters, and 12, but the length was assigned as 19 for future inserts

    A second table (table 2) has the same fields plus some others.

    The when update or insert records the trigger must complete these tasks:

    1. update record_is_search1 and record_id_search2 (default value 0) with the last six digits of the accountnumber1 and/or accountnumber2

    2. When update or insert accountnumber1 and/or accountnumber2 in table 1, update or insert those values in table 2 with the account number+8 digits assigned by us (date formated as 20041114)

    3. Last Update accountnumber1 and/or accountnumber2 in table 1 with the same values inserted or updated in table 2.

    I am able to do this one by one, but not with a trigger. Reason??? Not knowing how. PLEASE HELP!!

     

  • Thank you for the iput in this matter. I read a little more, test a few things and it seems to be working as I needed. Please consider this item as closed. Thank you

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply