In above table, I want to change state value i. Please check below result screen. We have updated state code column using CASE expression. I hope that you will get an idea about how to use CASE expression. Then explain how that maps to the SQL you're writing. So for that we have written given procedure but its not updating all the inserted data for the given rules. August 14, - pm UTC. So what precisely is the problem with the update I gave you earlier?
What specifically is it doing or not doing that makes the results incorrect? Please suggest. August 16, - pm UTC. I'm not seeing the problem here? You don't need to loop. In fact, that's a terrible idea.
You want one execution to process many rows. Not many executions processing one row each. What I am trying to say is there is an application where we are uploading. August 17, - am UTC. I'm still not seeing what the issue is. So you have an upload process in your app. When your user clicks that button, it then does two things: - Uploads the file - Runs the update to set the values appropriately So your code calls the upload routine, then the update. Now, the update could be in a stored procedure.
But whichever you do, you run the same update. The CASE statement is appropriate when there is some different action to be taken for each alternative.
If you just need to choose among several values to assign to a variable, you can code an assignment statement using a CASE expression instead. Only rows that meet the search condition are updated. If you omit this clause, all rows in the table are updated. This statement updates the row that was just fetched.
0コメント