Take the 2-minute tour ×

I want to create function which I will call in next context:

update mytab set processed = myfunc(mytab.data) where processed = 0

In myfunc I want to modify other tables. How should I implement this func?


share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

You shouldn't.

The only way to do it would be to cheat by opening a connection which is not the context connection and use that connection to modify the data. This would need your assembly to have EXTERNAL ACCESS permission, and is rather complicated, which is a sign that you should not do it. Use a stored procedure instead.

share|improve this answer
add comment

Usually, you would use stored procedures on the database side that can be called inside queries. You could alter the other tables there and then return the correct value for the "processed" field.

share|improve this answer
add comment

Your Answer


