MySQL’s SHOW CREATE TABLE for Oracle

Ever wondered, how to see create table code in Oracle?
as available in MySQL “show create table”

Here is how to do it

SQL> set pages 0
SQL> set long 999999
SQL> select dbms_metadata.get_ddl(‘TABLE’, ‘EMPLOYEES’, ‘EMP’) from dual;

Leave a Reply

Your email address will not be published. Please enter your name, email and a comment.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">