Updating inside an oracle
T-SQL is designed to be set-based, so it works on entire sets of data as a whole; it should NOT be used to work on data line-by-line.
If your table t1 and it's backup t2 have many columns, here's a compact way to do it.
I want to test a new grouping feature in our report tools using this DB, but I have to update and replace all of the 'numbers' (not being the key for that table). The updated numbers should follow a certain pattern to be auto-testable.
So here is waht I did so far: At first I query all unique 'numbers' in that table, then I loop over the result table to replace each of 'number' found with the generated 'new_number'.
In such a case, an another approach with bulk collectiong in chunks is required.
changed_buff.count INSERT INTO changed VALUES changed_buff( i ); END; / can contain ten thousands and more rows, then this procedure might be slow, becasue it will consume a huge amount of PGA memory.' ELSE 'Missing' END @Andomar - Presumably, the OP has control over the case expression (otherwise, how can they possibly fix it? If that's the case, then it seems logical that they would have the ability to reformat the In clauses before they get put into the Case expression.If budgpost is really a character column as is stated, then we have to assume that a non-numeric value might make its way into one of the In [email protected] - But then how would they fix the Case expression?You should try enclosing your parameters in single quotes (and you are missing the final THEN in the Case expression).UPDATE tab1 SET budgpost_gr1= CASE WHEN (budgpost in ('1001','1012','50055')) THEN 'BP_GR_A' WHEN (budgpost in ('5','10','98','0')) THEN 'BP_GR_B' WHEN (budgpost in ('11','876','7976','67465')) THEN 'What?
Search for updating inside an oracle:
I had it changed and the script runs and does what it was supposed to now.