问题描述
Hi, we work on oracle apps and using 12c Data Base in Back end. We Are using a concurrent program(shell script) to load data into staging table from front End.in data file we have data like below col 1 Col2 Col3 1025-1'-100-01, mfg1, 1025stacks 1066-1'-252-01, NSK -|| ABEC5, NULL 1071-1'-352-01, SAINT-GOBAIN, 504289229 1071-1'-358-01, "DAR,OID", 2-454 E893-80@ the program rejecting the rows contain ' for example col1 contains ' in 1st 1025-1'-100-01 so it was rejected.we have lots of records to load. i used escape character \ in data file like this 1025-1\''-100-01. but it did not work, only working with insert statement. So is there any alternative to avoid this issue?复制
专家解答
我假设你使用的是SQL Loader?
如果是这样,那么您所需要的只是 “由 ',' 分隔”,并且在控制文件中 * 不要 * 具有 “可选地由” 之类的内容。
如果是这样,那么您所需要的只是 “由 ',' 分隔”,并且在控制文件中 * 不要 * 具有 “可选地由” 之类的内容。
C:\Users\hamcdc>cat c:\temp\t.ctl load data INFILE * replace INTO TABLE t FIELDS TERMINATED BY ',' (col1 "trim(:col1)", col2 "trim(:col2)", col3 "trim(:col3)") begindata 1025-1'-100-01, mfg1, 1025stacks 1066-1'-252-01, NSK -|| ABEC5, NULL 1071-1'-352-01, SAINT-GOBAIN, 504289229 1071-1'-358-01, "DAR,OID", 2-454 E893-80@ C:\Users\hamcdc>sqlldr userid=mcdonac control=c:\temp\t.ctl Password: SQL*Loader: Release 12.1.0.2.0 - Production on Tue Feb 14 18:22:59 2017 Copyright (c) 1982, 2016, Oracle and/or its affiliates. All rights reserved. Path used: Conventional Commit point reached - logical record count 4 Table T: 4 Rows successfully loaded. Check the log file: t.log for more information about the load. SQL> select * from t; COL1 COL2 COL3 -------------------- -------------------- ---------------- 1025-1'-100-01 mfg1 1025stacks 1066-1'-252-01 NSK -|| ABEC5 NULL 1071-1'-352-01 SAINT-GOBAIN 504289229 1071-1'-358-01 "DAR OID"复制
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
Oracle DataGuard高可用性解决方案详解
孙莹
498次阅读
2025-03-26 23:27:33
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
477次阅读
2025-04-15 17:24:06
墨天轮个人数说知识点合集
JiekeXu
401次阅读
2025-04-01 15:56:03
XTTS跨版本迁移升级方案(11g to 19c RAC for Linux)
zwtian
395次阅读
2025-04-08 09:12:48
Oracle SQL 执行计划分析与优化指南
Digital Observer
368次阅读
2025-04-01 11:08:44
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
357次阅读
2025-04-18 14:18:38
Oracle 19c RAC更换IP实战,运维必看!
szrsu
338次阅读
2025-04-08 23:57:08
oracle定时任务常用攻略
virvle
313次阅读
2025-03-25 16:05:19
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
312次阅读
2025-04-15 14:48:05
风口浪尖!诚通证券扩容采购Oracle 793万...
Roger的数据库专栏
309次阅读
2025-03-24 09:42:53