| |

VerySource

 Forgot password?
 Register
Search
View: 1350|Reply: 2

==== How to get the structure of tables and views in ORACLE? ====

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Unknown

Post time: 2020-1-26 09:40:01
| Show all posts |Read mode
How to get the structure of tables and views in ORACLE?

For example, you can check it by querying the sysobjects table in SQL.

What to do in Oracle?
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-27 15:15:01
| Show all posts
select DBMS_METADATA.GET_DDL (object type, object name) from dual;

Object type:
CLUSTER
TABLE table
INDEX
REF_CONSTRAINT
CONSTRAINT
VIEW view
TYPE
FUNCTION
PROCEDURE
PACKAGE
SEQUENCE
TRIGGER
SYNONYM
DB_LINK

Such as:
select DBMS_METADATA.GET_DDL('TABLE','MYTABLE') from dual;
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-27 15:30:01
| Show all posts
If you want to obtain the structure of multiple tables at the same time:
select DBMS_METADATA.GET_DDL('TABLE',table_name) from USER_TABLES;
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list