Get DDL via SQLPLUS

set pagesize 0 -- The height of the page - number of lines, 0 will suppress all headings, page breaks, titles

set linesize 200 -- Width of a line (before wrapping to the next line)

set long 1000000000 -- Set the maximum width (in chars) for displaying and copying LONG values.

set longchunksize 1000000000 -- Set the fetch size (in chars) for retrieving LONG values.

select dbms_metadata.get_ddl('OBJECT_TYPE','OBJECT_NAME','SCHEMA') from dual ;

 

Because what dbms_metadata.get_ddl return is clob, we need to set long to retrieve all the content of the clob and set longchunksize to avoid line getting wrapped every 80 chars.

 

你可能感兴趣的:(sqlplus)