您可以使用Python脚本采取的护理出口,该CLOB的不会被截断:

from __future__ import print_function

from __future__ import division

import time

import cx_Oracle

def get_cursor():

'''

Get a cursor to the database

'''

# https://stackoverflow.com/questions/24149138/cx-oracle-doesnt-connect-when-using-sid-instead-of-service-name-on-connection-s

# http://www.oracle.com/technetwork/articles/dsl/prez-python-queries-101587.html

ip = '' # E.g. '127.0.0.1'

port = '' # e.g. '3306'

sid = ''

dsnStr = cx_Oracle.makedsn(ip, port, sid)

username = '' # E.g. 'FRANCK'

password = '' # E.g. '123456'

db = cx_Oracle.connect(user=username, password=password, dsn=dsnStr)

cursor = db.cursor()

return cursor

def read_sql(filename):

'''

Read an SQL file and return it as a string

'''

file = open(filename, 'r')

return ' '.join(file.readlines()).replace(';', '')

def execute_sql_file(filename, cursor, verbose = False, display_query = False):

'''

Execute an SQL file and return the results

'''

sql = read_sql(filename)

if display_query: print(sql)

start = time.time()

if verbose: print('SQL query started... ', end='')

cursor.execute(sql)

if verbose:

end = time.time()

print('SQL query done. (took {0} seconds)'.format(end - start))

return cursor

def main():

'''

This is the main function

'''

# Demo:

cursor = get_cursor()

sql_filename = 'your_query.sql' # Write your query there

cursor = execute_sql_file(sql_filename, cursor, True)

result_filename = 'result.csv' # Will export your query result there

result_file = open(result_filename, 'w')

delimiter = ','

for row in cursor:

for count, column in enumerate(row):

if count > 0: result_file.write(delimiter)

result_file.write(str(column))

result_file.write('\n')

result_file.close()

if __name__ == "__main__":

main()

#cProfile.run('main()') # if you want to do some profiling

oracle clob 粘贴,使用Oracle SQL Developer将CLOB导出到文本文件相关推荐

  1. Oracle安装步骤及PL/SQL Developer连接数据库

    一:Oracle安装步骤及PL/SQL Developer连接数据库 win7 64位 11g 点击(操作步骤):http://www.cnblogs.com/haoke/articles/27343 ...

  2. Oracle 12c 自带的SQL Developer新建连接出现的问题:Got minus one from a read call,connect lapse 60018 ms,....(已解决)

    Oracle 12c 自带的SQL Developer新建连接出现的问题:Got minus one from a read call,connect lapse 60018 ms,-(已解决) 以上 ...

  3. 本机不安装Oracle客户端,使用PL/SQL Developer和 Instant Client 工具包连接oracle 11g远程数据库

    1,先到Oracle网站下载Instant Client : http://www.oracle.com/technology/global/cn/software/tech/oci/instantc ...

  4. Oracle客户端安装以及PL/SQL Developer安装方法

    1,安装Oracle客户端 2,配置数据库,如下: 安装路径:D:\app\ThinkPad\product\11.2.0\client_1\network\admin 建立文件:tnsnames.o ...

  5. oracle批量粘贴文本,ORACLE 快速批量导入文本数据到数据库(sqlldr工具)方法与分析...

    在实际生产环境中,常会碰到将一些如通过通讯接口传过来的数据(文本文件 txt)导入到数据库的某张表中.通常做法是使用ORACLE自带的包功能打开文件,将文件中的数据用LOOP循环一行行读入内存数组中, ...

  6. excel数据复制粘贴入PL/SQL Developer的方法

    如需转载,请注明来源,谢谢合作. 若本文对您有一点点的帮助,欢迎点赞.评论和关注.您的鼓励和支持是我继续学习和分享的动力. 推荐免费.高效.入门级的SQL教程http://www.w3school.c ...

  7. PL/SQL developer连接64位oracle关于ori.dll的问题以及中文乱码解决方案

    之前电脑用的是win7系统32位,安装的Oracle32位,通过PL/SQL developer连接远程数据库运行良好,可是升级成win10系统64位的时候,就发现问题,主要报错oci.dll的问题. ...

  8. Windows 7 下安装 Oracle 数据库和 PL/SQL Developer

    win7下无论是32bits还是64bits,建议只安装oracle 11g 32bits,然后直接安装pl/sql developer,不需要额外的配置,就可以通过pl/sql developer来 ...

  9. 通过PL/SQL developer工具访问远程的Oracle数据库_访问数据库_连接数据库_登录数据库

    文章目录 工具简介 电脑没有安装 Oracle 数据库 电脑安装了 Oracle 数据库 工具简介 PL/SQL Developer 是 Oracle 数据库开发工具,PL/SQL Developer ...

最新文章

  1. oracle的存储过程调试,oracle 运行普通方式及调试debug方式存储过程性能区别
  2. python 条形图图注怎么集中注意力_如何用每个条形图的总和(Matplotlib)注释堆积条形图?...
  3. 洛谷 P3177 [HAOI2015]树上染色
  4. 汇编语言(十三)之偶数转成哥德巴赫猜想
  5. 未定义变量: data_三、变量声明
  6. 相机标定(3) opencv中solvePnPRansac()和solvePnP()计算外参数
  7. CSS 盒倒影 box-reflect属性
  8. Android语音识别(本地+第三方)
  9. UDP协议的收发操作
  10. iTextSharp 生成pdf Form 实例
  11. idea 查看jsp是否被引用_idea 查看jsp是否被引用_IntelliJ IDEA解析JSP中的Web路径
  12. 在dw中 新建html快捷键,了解 Dreamweaver 中的默认键盘快捷键以及如何自定义键盘快捷键...
  13. 面向对象编程中的 诡异事件
  14. Oracle 增加USERS表空间
  15. 杂谈:微信为什么不出小号功能?
  16. win7 linux三系统,苹果电脑装windows7,Linux,mac os三系统,不需要BootBoot | MOS86
  17. 失落的帝国攻略java,失落的帝国 --- 吴哥旅游日记(8)
  18. java俄罗斯方块英文书籍_Java版俄罗斯方块
  19. css 横线中间的文字
  20. 基于Java毕业设计银行招聘系统设计源码+系统+mysql+lw文档+部署软件

热门文章

  1. .NET图像处理包 DotImage
  2. 晚上大龙哥带来了一本vb教程,由于好奇看了下
  3. Window平台下通过cmd命令查看端口占用、查看进程、结束进程
  4. c语言中队列的作用,循环队列的实现(C语言)
  5. 现代计算机网络发展为第几代,晶体管计算机是第几代_个人计算机使用的电子元器件_计算机网络最突出的(6)...
  6. mysql最大字段数_mysql最大字段数量及 varchar类型总结
  7. R语言︱R社区的简单解析(CRAN、CRAN Task View)
  8. Proxy-Go v7.0 发布,你应该拥有的强大代理工具!
  9. 低频段用于4G,电信联通仍难改劣势
  10. AVD Manager