-
rpad(...,...,...)
Hi All,
Am trying to insert 50As if the column is null
e.g
select decode('','',rpad('',50,'A'),'') from dual
Need help, above code is not working, any idea.
Thanks in advance.
-
You need the column name, compare:
select decode(dummy,NULL,rpad(dummy,50,'A'),dummy) from dual;
select decode(dummy,'X',rpad(dummy,50,'A'),dummy) from dual;
-
Hi,
Still not working,
for example
if dname is null then I need to add 5 As.
select decode(dname,null,rpad(dname,5,'A') from dept;
Thanks.
-
select decode(dname,null,rpad('A',5,'A'), dname) from dept;
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
Excellent jmodic, it works..
Thanks
-
Nvl(dname,'AAAAA') might be more intuitive.
-
Nvl(dname,rpad('A',50,'A')) would save counting 50 of them. (Most probably wrongly if I were doing it).
-
Is it "5", or "50"? Seems to be some confusion. if 50, then RPAD('A',50,'A') is indeed more robust.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|