I have an Oracle table that contains data on the column ORG_KEY. I need to remove the whitespace after the data and retain the same values for all rows. How can I do this like:
update migadm.MAINRETAIL_MIG
set orgkey = select trim (orgkey) from migadm.MAINRETAIL_MIG
Please help
To strip trailing whitespace you can use the
rtrimfunction; for instance:I’d imagine your
updatestatement would become (notice the extra parenthesis):However, this would update every
orgkeyto be the same so I think you still have a mistake. Maybe you meant something like the following, which will update everyorgkeyto be the right trimmed version of itself?