oracle 查詢表名以及表的列名建站知識
導讀:1建站知識oracle 查詢表名以及表的列名的代碼。網站建設哪家好公司網站建設。
1.查詢表名:
復制代碼 代碼如下:
select table_name,tablespace_name,temporary from user_tables [where table_name=表名]
其中:table_name:表名(varchar2(30)); tablespace_name:存儲表名的表空間(varchar2(30)); temporary:是否為臨時表(varchar2(1))。 eg: select table_name,tablespace_name,temporary from user_tables where table_name='TEST_TEMP'; 結果: ------------------------------------------------------------企業網站建設-------------------- table_name tablespace_name temporary TEST_TEMP SDMP N -------------------------------------------------------------------------------- 注:表名變量值必須大寫。 2.查詢表列名:復制代碼 代碼如下:
select column_name,data_type ,data_length,data_precision,data_scale from user_tab_columns [where table_name=表名];
其中:column_name:列名(varchar2(30)); data_type:列的數據類型(varchar2(106)); data_length:列的長度(number); eg:select column_name,data_type ,data_length,data_precision,data_scale from user_tab_columns where table_name='TEST_TEMP'; 結果: -------------------------------------------------------------------------------- column_name百度seo網站優化 data_type data_length data_precision data_scale ID NUMBER 22 0 NAME NVARCHAR2 20 SEX CHAR 1 GRADE NVARCHAR2 10 -------------------------------------------------------------------------------- 注:表名變量值必須大寫。 另外,也可以通過 all_tab_columns來獲取相關表的數據。 eg:select * from all_tab_columns wher網站建設哪家好e table_name='TEST_TEMP';相關網站建設哪家好公司網站建設。聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-24 ,文章oracle 查詢表名以及表的列名建站知識主要講述標簽,標題,oracle 查詢表名以及表的列名建站知識網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_6690.html