I am writing a trigger with some business logic in it. I want to compare some old value from the table and insert according to some condition.
But I am not sure SELECT INTO works good as I have searched extensively on the web. There is no handler it seems in trigger that is allowed.
I know I have not tried and checked the result myself. But would like to hear your inputs if you have used SELECT statements in a trigger. Is what I am doing is likely to find a solution to my problem?
Which database are you using? The exact implementation will heavily depend upon that.
I don't think SELECT INTO will come into play at all. The values of modified rows are generally passed into the trigger as parameters - otherwise you wouldn't know how to find the row that is being modified. This might be the reason why your search came up empty. Searching for <your database> before trigger might give much more relevant result.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads