![How to update values using multiple primary keys [closed] How to update values using multiple primary keys [closed]](https://www.lifewire.com/thmb/hF0H0-PP1ZUREWu1ZhxQD48ZRdY=/1280x847/filters:fill(auto,1)/482541301-56a227c95f9b58b7d0c7498c.jpg)
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
Microneedling vs. Chemical Peels: Which One Is Better for Your Skin?
When it comes to skincare treatments that rejuvenate and enhance the skin’s appearance, microneedling and chemical peels are two of...
Advances in Spinal Fusion for Degenerative Disc Disease with Dr. Larry Davidson
Degenerative disc disease (DDD) is a common condition that affects the intervertebral discs, which serve as cushions between the vertebrae,...
A Comparison between Vibratory and Impact Compactors
Contractors are often left battling their logic on which type of roller compactor to hire as these heavy machines apart...
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...