Jump to content
  • 0

Trigger logic doesn't make sense?


Casper
 Share

Question

Hi, hope someone can help me out on this as this is driving me nuts. It might sound stupid but its actually a very simple application of matching.

I am trying to match two numbers in Table 1 (Test) and if they matched, update the result on Table 2 (Test2). My problem is when the number matches, it shows me the result "Not matched" and vice versa. The result is inverse of the logic that I have built. Of course I could live with it, just inverse all the results but I feel that I might be missing something here so hope someone can advise me. As below are the screenshots of both tables and the trigger logic for Test Table. Thanks.

1555263211_Screenshot2022-05-10at2_50_28PM.png.1787a9fbf176d9796bd0af6b74403c34.png

 

832719571_Screenshot2022-05-10at2_50_53PM.thumb.png.4fd463fe5e9aad0bbbc07fefbabcff04.png

147070841_Screenshot2022-05-10at2_50_43PM.png.c4275e3765e315f0730f4a9c5dc5b7ee.png

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @Casper,

As far as I understood you need to match numbers on insert and update and insert the status in a different table. What this trigger does, it checks if the ID is already present in the Second table. If NO - then Insert new record with the proper status, if YES - then Update existing record.

image.png

Here is tables design as well:

image.png         image.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...