Spool the data from a CLOB

12,384

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

Share:
12,384
Moudiz
Author by

Moudiz

I work with oracle and Sybase.

Updated on June 13, 2022

Comments

  • Moudiz
    Moudiz about 2 years

    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 .

    Example: select info from ex_employee where data <15

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


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

    My PROBLEM IS : How to export the CLOB data into .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

  • Moudiz
    Moudiz almost 11 years
    the problem with this it wwill not give me all the constraint .. i tried it.