简体   繁体   English

使用sql loader加载时如何用逗号(',')替换为句点('。')

[英]How to replace a comma (',') with a period ('.') while loading using sql loader

I have number(20,4) field for which the data is coming in the following format : 我有number(20,4)字段,其数据以以下格式显示:

120,24
200,45

I want to insert it into a table in the following format : 我想以以下格式将其插入到表中:

120.24
200.45

Below is the control file : 下面是控制文件:

LOAD DATA
TRUNCATE INTO TABLE TEMP_TARIFICACION_FIJA_69
FIELDS TERMINATED BY '|' 
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
ID EXPRESSION "TARIFICACION_FIJA_69_SEQ.nextval",
TIPO,
SECTARIFA,
IDFECTAR,
IDGRPDES,
IDCLAISDEST,
IDTIPUSO,
IDTIPHOR,
MONTO "REPLACE (:MONTO,',','.')",
IDOPERADOR,
LAST_MODIFIED_DATE "SYSDATE"
)

I want to replace the field MONTO. 我要替换字段MONTO。 I am trying with the above control file but it is not working. 我正在尝试使用上述控制文件,但无法正常工作。 How can I achieve this ? 我该如何实现? Please help me. 请帮我。 Thanks in advance. 提前致谢。

你可以尝试一下:

monto    "TO_NUMBER(:monto,'999D99', 'NLS_NUMERIC_CHARACTERS='',.''')",

试试这个monto "to_number(replace(:nilai_pph,',','.'))"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM