【导入导出】sqlldr 导入含有内嵌换行符的数据

简介: 如何加载含有内嵌换行符的数据,这里使用了使用非换行符的chr(10)来代替换行符,在加载数据时使用一个sql函数来完成该任务。load datainfile * into table deptappendfields terminated by  ','trai...
如何加载含有内嵌换行符的数据,这里使用了使用非换行符的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

目录
相关文章
|
5月前
|
SQL 数据库
PowerDesigner导出SQL脚本运行注释出现乱码问题
PowerDesigner导出SQL脚本运行注释出现乱码问题
104 0
|
2月前
EsayExcel文件导入导出
EsayExcel文件导入导出
37 3
|
8月前
|
JSON Java 应用服务中间件
利用esaypoi自定义Excel表格模板导入与导出表单数据
今天工作中又遇到了excel导出数据的功能,在这里我将自己自定义的Excel模板和相关的代码拿出来,解释一下如何进行操作,以便日后能够方便的进行功能开发,提高效率。
430 0
|
前端开发 JavaScript 容器
vue导出excel表格-后端返回blob流文件,前端接收并导出(处理导出以后打开文件损坏问题)
vue导出excel表格-后端返回blob流文件,前端接收并导出(处理导出以后打开文件损坏问题)
716 0
|
SQL Shell 数据库
shell 自动导出导入数据库,将导出的格式为 : 数据库名+时间.sql
mysqldump 自动导出mysql8 or mariadb10x 数据库工具,导入数据库工具,mysql 创建于删除数据库
148 0
|
Java 关系型数据库 数据库连接
导出文件:使用lowagie.itext导出数据为Word文件
导出文件:使用lowagie.itext导出数据为Word文件
361 0
导出文件:使用lowagie.itext导出数据为Word文件
|
Web App开发 JavaScript
十七 bootstrap-table tableExport 导出xlsx格式表格
原文:十七 bootstrap-table tableExport 导出xlsx格式表格 在[十六、bootstrap-table javascript导出数据]中,打开导出的表格时,总会弹出一个提示窗 那么,导出xlsx格式的应该就没问题了吧?!实验如下,查找tableExport.js资料 TableExport插件依赖于jQuery(1.2.1+),FileSaver.js。
4359 0