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?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.