Update a table value with out using update command
Is it possible to update a table value with out using update command? if yes what is the reason, if no what is the reason?
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
dev 027 reputationPosted Nov 14, 2011, 8:57 PM EST
Use merge command. If the rows already exist then it will
update it with new data if not it would insert the new data
Hope this will help you.
Thanks
Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 14, 2011, 8:59 PM EST
its not possible without update command n the reason is........ if yes then some user dont have pevilage to update even he can update......it will voilate access rights.
if you have insert delete permision then can do 1 thing delete n reinsert that row with new record....but this is worst solution as if someone dont have update rights then he dont have insert,delete rights too....
Thanks,i hope i am specific to you quetion.
Pravin.
AartiRank #2,383 · 594 reputationPosted Nov 14, 2011, 9:36 PM EST
use Replace command
replace into tablename(primary key,....{rest of the columns in the table}) values(the same primary key, new values );
this will delete the previous row and insert a new row with the same primary key and updated column values.
I hope it will help you..
Thanks.
Arjun PanwarRank #254 · 9.9K reputationPosted Nov 15, 2011, 12:00 AM EST
Mr Pravin
do you agree with Deepika reply ?
Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 15, 2011, 1:40 AM EST
but arjun my point was when we look for something other that update statement?? is when we dont have permision to update....so when someone dont have permision for "Update" he even dont have it for "replace into" too.....
Thanks,
Pravin.
Arjun PanwarRank #254 · 9.9K reputationPosted Nov 15, 2011, 2:11 AM EST
Thanks for giving the best answer.
AartiRank #2,383 · 594 reputationPosted Nov 15, 2011, 2:27 AM EST
Update a table value with out using update command
then i suggest by using Replace we can update value of table. :)
Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 15, 2011, 7:00 PM EST
Thanks,
Pravin