Link to home
Start Free TrialLog in
Avatar of Snody
Snody

asked on

script to update row with condition

Hi,

I need a sciprt for oracle to update a column. The single entry only should updated if a condition is met.

A little bit more detailed:
If the last char is a ", the script should do nothing. If not " is the last char, it should add a " at the end of the text string. Then commit the changes and go to the next entry...

It would be nice if anybody can help me :)

Greets and best regards,
Andy


Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

update yourtable
set yourcolumn = concat ( youcolumn , '"' )
where substr ( yourcolumn , length( yourcolumn) 1 ) <> '"'
ASKER CERTIFIED SOLUTION
Avatar of geotiger
geotiger

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Snody
Snody

ASKER

Thx @ both of you. I used the solution of geotiger but johnsone gave me an exact answer for my question. But i din't have to commit every row. I did it only once. But I'm sure johnsone's way would work too...

Greets and best Regards,
Andy