Oracle的小應用

2021-08-31 19:40:21 字數 465 閱讀 7623

今天同事打**讓我把資料庫中的乙個使用者下所有表的注釋匯出.通過構建相關的sql實現相關功能如下:

1.登入遠端伺服器

sqlplus tbs/***[email protected]/ticket

2.設定各種引數

set linesize 1000

set pagesize 10000

3.匯出相關的列的注釋資訊

spool tbs_comment_on_column.txt

select t.table_name || '.' || t.column_name || ' is ''' || t.comments ||''';' from user_col_comments t;

spool off

4.檢視匯出位置:

unix/hp-ux: host pwd

window : host dir

oracle查詢應用小技巧收集

第乙個小知識點 clear 在oracle中也可以用以清除螢幕上的內容 第二個小知識點 在乙個表中插入自身的查詢結果 insert into my table id,name,age select id,name,age from my table 第三個小知識點 oracle中null 不能進行運...

oracle 函式的應用

返回日期型 create or replace function getplandate v date in date,v cnt in number 傳入當前時間,期數 return date asy number m number d number last cnt date date last...

Oracle 序列的應用

oracle建立序列,刪除序列,得到序列序列的建立 create sequence seq newsid increment by 1 start with 1 maxvalue 999999999 得到序列的sql語句 select seq newsid.nextval from sys.dual...