Charles Morrison
Charles Morrison

Reputation: 428

oracle convert to number

I am trying to convert 193 to 1000000193 in oracle. 193 could be any number less than 1000000000

This does not work.

select to_char(193,'1000000000') from dual;

Upvotes: 0

Views: 155

Answers (2)

Charles Morrison
Charles Morrison

Reputation: 428

i suppose this works.

select '1' || LPAD('193',9,'0') from dual

Upvotes: 2

Serkan Arıkuşu
Serkan Arıkuşu

Reputation: 5609

Why can't we add them?

select 193+1000000000 from dual;

Upvotes: 2

Related Questions