小编XLD*_*D_a的帖子

How to insert zeros into a string?

I have a string, for example X1. I need to create a new string by inserting zeros into it. To be more specific:

for X1 the new string will be X0001;
for X10 the new string will be X0010;
for X100 the new string will be X0100;
for X1000 the new string will be X1000.


The length of the new string is 5.
Run Code Online (Sandbox Code Playgroud)

I have tried to do this:

select substr('X1', 1, 1) || '000' || substr('X1', 2) from dual; …
Run Code Online (Sandbox Code Playgroud)

sql string oracle toad

3
推荐指数
1
解决办法
64
查看次数

小数分隔符oracle

我需要用点替换逗号然后我需要我的值是一个数字.所以我写了这个:

select replace('12345,6789', ',' , '.') from dual --it works fine
Run Code Online (Sandbox Code Playgroud)

但后来我想转换to_number该值,我得到错误:

"invalid number"

sql oracle decimal

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

oracle ×2

sql ×2

decimal ×1

string ×1

toad ×1