获取 Oracle 架构 [英] Get Oracle Schema

查看:58
本文介绍了获取 Oracle 架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以在 c# 中检索 oracle 模式?这些是我需要的:表_名称,表列_名称,主键,唯一键,外键

Is there any way to retrieve oracle schema in c#? These are what I need: Tables_Name, Table Columns_Name, Primary Keys, Unique Keys, Foreign Keys

推荐答案

表名:

select * from user_tables

表列名称::>

select * from user_tab_columns

主键、唯一键、外键:

select * from user_constraints

更一般的:

select * from dictionary

查看您可以使用的所有可能的系统视图.

to see all the possible system views you can use.

如果您想要用于创建表等的实际 DDL,您可以使用 dbms_metadata.get_ddl,返回一个 CLOB.

If you want the actual DDL used to create the tables etc you can use dbms_metadata.get_ddl, which returns a CLOB.

例如:

select dbms_metadata.get_ddl('TABLE','MY_TABLE') from dual;

这篇关于获取 Oracle 架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆