Search This Blog

Showing posts with label Check if string contains all zeros in Oracle SQL lpad decode length. Show all posts
Showing posts with label Check if string contains all zeros in Oracle SQL lpad decode length. Show all posts

Monday, March 26, 2012

Check if string contains all zeros in Oracle

select rpad (nvl (decode('X000',lpad('0',length('X000'),'0'),lpad(' ',length('X000'),' '),'X000'), chr (32)), 15, ' ') from dual