Home > Database > Mysql Tutorial > How to Retrieve Table Definitions in Oracle SQL, Equivalent to MySQL's SHOW CREATE TABLE?

How to Retrieve Table Definitions in Oracle SQL, Equivalent to MySQL's SHOW CREATE TABLE?

Susan Sarandon
Release: 2025-01-03 11:43:43
Original
655 people have browsed it

How to Retrieve Table Definitions in Oracle SQL, Equivalent to MySQL's SHOW CREATE TABLE?

Equivalent to MySQL's SHOW CREATE TABLE in Oracle SQL

MySQL offers the SHOW CREATE TABLE statement to retrieve the definition of a table. Is there a similar functionality in Oracle SQL?

Oracle SQL Equivalents

SQL*Plus provides the DESC command:

SQL> DESC EMP;
Copy after login

This will display the columns, data types, and other table attributes.

For a pure SQL statement, use the DBMS_METADATA package:

SELECT DBMS_METADATA.GET_DDL('TABLE', 'EMP', 'SCOTT')
FROM DUAL;
Copy after login

This will return the full DDL for the specified table.

Additional Considerations

Some tools may require setting SET LONG 10000 before executing these commands to display LOBs longer than 10,000 bytes.

The above is the detailed content of How to Retrieve Table Definitions in Oracle SQL, Equivalent to MySQL's SHOW CREATE TABLE?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template