Oracle數據庫的基本語句很多,以下是查看某表的約束條件的:
SQL>select constraint_name, constraint_type,search_condition, r_constraint_name
from user_constraints where table_name = upper('&table_name');
SQL>select c.constraint_name,c.constraint_type,cc.column_name
from user_constraints c,user_cons_columns cc
where c.owner = upper('&table_owner') and c.table_name = upper('&table_name')
and c.owner = cc.owner and c.constraint_name = cc.constraint_name
order by cc.position;
收起
2021-08-16
晉正
回答
Oracle數據庫基本語句如下:
查看視圖的名稱
SQL>select view_name from user_views;
查看創建視圖的select語句
SQL>set view_name,text_length from user_views;
SQL>set long 2000; 說明:可以根據視圖的text_length值設定set long 的大小
SQL>select text from user_views where view_name=upper('&view_name');
收起
2021-08-16
繁暎
回答
Oracle數據庫難度比較大,基本語句非常多:
存儲函數和過程
查看函數和過程的狀態
SQL>select object_name,status from user_objects where object_type='FUNCTION';
SQL>select object_name,status from user_objects where object_type='PROCEDURE';
查看函數和過程的源代碼
SQL>select text from all_source where owner=user and name=upper('&plsql_name');
收起