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
Lab Created Diamonds Barcelona: The Upheaval of Lab Diamonds
As the world movements towards additional maintainable and morally obtained other options, lab created diamonds have turned into a developing...
Cultures and Lab-Grown Diamonds: The Cutting edge Unrest in Gems
In the realm of fine adornments, cultures and lab grown diamonds are causing disturbances, upsetting the market with their moral,...
Custom Engagement Rings Singapore: The Ascent of Lab Diamonds
With regards to finding the ideal engagement ring, many couples in Singapore are deciding on custom plans that mirror their...
Shopping for Lab Grown Diamonds in Barcelona: What You Need to Know
Lab grown diamonds are revolutionizing the jewelry industry in Barcelona and beyond. These diamonds, cultivated in laboratories rather than mined...
Synthetic Sparkle: Exploring Lab Diamonds in Cultural Contexts
Introduction Diamonds, both natural and lab-grown, have captivated societies globally. Lab diamonds, also known as synthetic or cultured diamonds, are...
Diamond Shapes Revealed: Advantages and Disadvantages Explored
Diamonds come in various shapes, each with its own unique characteristics that appeal to different tastes and preferences. Understanding the...