博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【导入导出】sqlldr 导入含有内嵌换行符的数据
阅读量:6876 次
发布时间:2019-06-26

本文共 868 字,大约阅读时间需要 2 分钟。

如何加载含有内嵌换行符的数据,这里使用了使用非换行符的chr(10)来代替换行符,在加载数据时使用一个sql函数来完成该任务。
load data
infile *
into table dept
append
fields terminated by  ','
trailing nullcols
( deptno,
  dname,
  loc,
  comments
"replace(:comments,'\\n',chr(10))"---注意函数的用法
 )
begindata
10,sales,hangzhou,this is the sales\noffice in hz
20,consulting,hangzhou,this is the consulting\noffice in hz
30,accounting,hangzhou,this is the accounting\noffice in hz
40,finance,hangzhou,this is the finance\noffice in hz
查询验证。
yang@ORACL> col comments for a50
yang@ORACL> select * from dept;
    DEPTNO DNAME          LOC           COMMENTS
---------- -------------- ------------- --------------------------------------------------
        10 sales          hangzhou      this is the sales
                                         office in hz
        20 consulting     hangzhou      this is the consulting
                                         office in hz
        30 accounting     hangzhou      this is the accounting
                                         office in hz
        40 finance        hangzhou      this is the finance
                                         office in hz

转载地址:http://mfwbl.baihongyu.com/

你可能感兴趣的文章
源码探探之startActivity(二)
查看>>
深入了解Flutter的isolate(1) ---- 事件循环(event loop)及代码运行顺序
查看>>
startService() 过程
查看>>
WebSocket 协议 1~4 节
查看>>
Android-WItemTouchHelperPlus几行代码搞定仿QQ侧滑
查看>>
Glide 知识梳理(5) 自定义GlideModule
查看>>
聊聊eureka的delta配置
查看>>
Masonry 源码解读(下)
查看>>
Swift如何给应用添加3D Touch菜单
查看>>
05_Node js 文件管理模块 fs
查看>>
关于python中可迭代对象和迭代器的一些理解
查看>>
界面无小事(五):自定义TextView
查看>>
ES6读书笔记(三)
查看>>
视频播放器全屏旋转方案
查看>>
根据调试工具看Vue源码之生命周期(一)
查看>>
RxJS教程
查看>>
在高并发环境下Reids做缓存踩坑记录
查看>>
通俗易懂--岭回归(L2)、lasso回归(L1)、ElasticNet讲解(算法+案例)
查看>>
Word类报表实例 - 质量检测报告
查看>>
Java进阶篇设计模式之二 ----- 工厂模式
查看>>