sql - Any keyword to skip the current row in DB2 trigger -


i have write trigger insert data db if doesn't exists. wrote till inserting records. doing signaling if data exists failing entire batch of records.

   questions: there keyword skip/ignore/discard current row?     trigger below. want remove signal , keep else     discard/ignore/skip current row insertion. example : continue keyword in java  .     create or replace trigger tri_books_edit     no cascade before insert on books     referencing new n    each row     when ((select count(*) books book_name = n.book_name , author = n.author) > 0)    signal sqlstate '75000' set message_text = 'duplicate row same name , author'      

you don't need use trigger this. add unique index on 2 fields:

create unique index books_name_author on books(book_name, author); 

much simpler solution preventing duplicates.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -