I want to insert into two tables from one table based on vlaue on sourcestring value as per type, like if 'protection' then in protection table else in 'configuration' table

I want to insert into two tables from one table based on vlaue on sourcestring value as per type, like if 'protection' then in protection table else in 'configuration' table

Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Srinivasan RamamoorthiRank #877 · 2.5K reputationPosted Oct 21, 2021, 10:31 PM EDT
You can write a stored procedure with cursor and if condition. I won’t recommend doing this with query. Later you can enhance the procedure to add more logic or include transaction support and exception handling.
Sachin SinghRank #66 · 26.2K reputationPosted Oct 22, 2021, 1:19 AM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Oct 22, 2021, 12:52 AM EDT
Siddhant panda29 reputationPosted Oct 25, 2021, 1:24 AM EDT