Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Add Spaces If Null

Angus123Sep 8 2021

Hi
I have a column varchar2(100) in a table.
Some rows have data, some just null
I need to update the table so if this col A is null then the column A should be update to contain 100 spaces.
This should also happen on the insert of a new rows
I think I should be using rpad but what I have done does not seem to have worked
update AAA
set COLA = rpad(' ', 100)
where colA is null;
Any advice please
Gus

This post has been answered by cormaco on Sep 8 2021
Jump to Answer
Comments
Post Details
Added on Sep 8 2021
5 comments
2,781 views