How to update values using multiple primary keys [closed]
I have a table which contains multiple 3 primary keys and some other table contains 2 primary key using this primary keys I am going to update the values.
If it contains single primary key its getting updated but for 2-3 primary key its not getting matched and not updating. Can you please help me to get updated if it contains 2 or more primary keys.
Here is the code:
for i in range(len(col_INCR_list)):
merge= "merge "+str(a)+" Target using "+str(a)+"_INCR Source on Source."+str(pk_INCR_list[0])+" = Target."+str(pk_list[0])+" when matched then update set Target."+str(col_list[i])+" =Source."+str(col_INCR_list[i])+" when not matched by target then insert ("+str(pk_list[0])+") values(Source."+str(pk_INCR_list[0])+");"
print(merge)
query=engine.execute(text(merge).execution_options(autocommit=True))
print(query)
More Stories
Unlocking the Mysteries of HPHT Diamonds: Everything You Need to Know
Introduction to HPHT Diamonds Diamonds have always been revered for their beauty, durability, and rarity. However, not all diamonds are...
Buy Silver Bars Adelaide: Your Guide to Investing Wisely
In today's volatile market, investors are constantly seeking safe havens to protect their wealth. One such option that has stood...
5 Game Playstar Slot Leaks That Often Give You Jackpot Wins
Exploring the world of Playstar slot games, we seem to have entered a secret labyrinth where 5 interesting leaks are...
The 5 Best Raffle Draws Ideas
Introduction: In the grand tapestry of life, there exists a captivating symphony, where the delicate notes of risk and reward...
Vehicle Transport Service: Safely Ship Your Vehicle Nationwide
Introduction When it comes to relocating or buying a vehicle in a different city or state, one of the major...
Custom Poker Chips – Essential To The Poker Experience
A Well-Known Card Game Poker is a well-known card game played across the globe and is filled with excitement and...