oracle 从 CLOB 假脱机数据

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17447829/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 01:46:36  来源:igfitidea点击:

Spool the data from a CLOB

oracleplsqldeveloper

提问by Moudiz

I have the result of several CLOB, (about 100 Clob). I want to to extract all the data in the CLOB in one one script. I searched for spool but for now I didnt how to use it .

我有几个CLOB的结果,(大约100个Clob)。我想在一个脚本中提取 CLOB 中的所有数据。我搜索了线轴,但现在我不知道如何使用它。

Example: select info from ex_employee where data <15

示例:从 ex_employee 中选择信息,其中数据 <15

INFO
< CLOB >
< CLOB >
< CLOB >
< CLOB >
< CLOB >

信息
< CLOB >
< CLOB >
< CLOB >
< CLOB >
< CLOB >


those CLOB contain informations how can I spool them into a script example.sql?


那些 CLOB 包含信息如何将它们假脱机到脚本 example.sql 中?

My PROBLEM IS : How to export the CLOB data into .sql ?

我的问题是:如何将 CLOB 数据导出到 .sql 中?

I tried this way
Spool on
set heading off
Spool c:\spooltext.txt
select dbms_metadata.get_ddl('TABLE', table_name)
from user_tables
/
Spool off

我试过这种方式
Spool on
set heading off
Spool c:\spooltext.txt
select dbms_metadata.get_ddl('TABLE', table_name)
from user_tables
/
Spool off

采纳答案by Gaurav Soni

Try this ,because it work for me in toad

试试这个,因为它对我有用

SET HEADING OFF
SET PAGESIZE 0
SET LONG 90000
SET FEEDBACK OFF
SET ECHO OFF
SPOOL P:\other\file_name.sql

SELECT DBMS_METADATA.get_ddl ('TABLE', table_name) || ';' FROM user_tables;

SPOOL OFF

And this works in command prompt too

这也适用于命令提示符