I'm building an app that inserts data into table A, then I want a trigger to kick off before new data is inserted into table B to confirm that the value exists in column string_Value and then take the data and add it into TABLE C.
I have values in my trusted column and values being dumped into an untrusted column. When data is equal to the trusted column then everything is ok but when it's not it should log into another table for further processing.
So, you want to compare the string that you want to insert into table B against the values in table A, if they match then the insert should go fine, otherwise you want to insert the value into table C. Correct?
If I'm not wrong, a trigger cannot stop the insert statement, unless you use SIGNAL with MySQL 5.5+, but this will cause an error.
You could use procedure instead of the insert & trigger events, so instead of:
insert into tableB (value) values('oranges');
it will be something like:
And from there you decide where to insert the value.
When statement is true ignore query and continue with next insert. My problem now is when my tblInput grows so does the time for each new tblInput. Is there a way of getting rid of the time it takes to input false results into tblOutput.
My current tblInput has 20 000 lines and it takes +-1 minute to complete 1 line so it takes +- 10 minutes to complete 10 line's which is not helpfull at all in the program I'm building.
Any tips for running a query on a table and getting rid of the time constraint?