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!

extra space while I am concating two string (to_char)

H.Jan 29 2009 — edited Jan 29 2009
Hello All,

Can anyone tell me why am I getting extra space ?

I ran "select concat(to_char(sysdate,'YYYY'),to_char(to_number(substr('20090001',5,8),'9999') + 1,'0009')) from patelh.new_hire_posn;"
and it gave me :

CONCAT(TO_CHAR(SYSDATE,'YYYY'),TO_CHAR(TO_NUMBER(SUBSTR('20090001',5,8),'9999')+1,'0009'))-----
*2009 0002*

1 rows selected

I want result like "20090002"... !!!!

I think I don't understand concept of to_char and to_number ...!!!!


Thank you,
H.

Edited by: H. on Jan 29, 2009 8:09 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 26 2009
Added on Jan 29 2009
4 comments
2,751 views