在sql*plus裡編輯SQL命令
常用的編輯命令,包括append, change, input, del, list, clear buffer等
[@more@]SQL> select owner,object_nam
2 from dba_objects;
select owner,object_nam
*
ERROR at line 1:
ORA-00904: "OBJECT_NAM": invalid identifier
1. 將object_name改成object_name,用change (C)
SQL> c/nam/name
1* select owner,object_name
檢視修改後結果,用list
SQL> list
1 select owner,object_name
2* from dba_objects
SQL> /
2. 在結果集中增加一列object_id,用append (A)
--先列出buffer中第一行sql
SQL> list 1
1* select owner,object_name
--在結果中增加一列
SQL> a ,object_id
1* select owner,object_name,object_id
--檢視修改後的sql
SQL> list
1 select owner,object_name,object_id
2* from dba_objects
3. 往sql中追加2行,用input (I)
SQL> input
3 where owner='SYSTEM'
4 and rownum<6
5 /
--檢視修改後的sql
SQL> list
1 select owner,object_name,object_id
2 from dba_objects
3 where owner='SYSTEM'
4* and rownum<6
4. 刪除最後一行,用del last
SQL> del last
SQL> list
1 select owner,object_name,object_id
2 from dba_objects
3* where owner='SYSTEM'
5. 清除buffer裡暫存的內容,用clear buffer (cl buff)
SQL> clear buffer
buffer cleared
--檢視buffer裡的內容d
SQL> list
SP2-0223: No lines in SQL buffer.
所有sql script編輯命令參考:
Command | Abbreviation | Purpose |
---|---|---|
APPEND text | A text | adds text at the end of a line |
CHANGE /old/new | C /old/new | changes old to new in a line |
CHANGE /text | C /text | deletes text from a line |
CLEAR BUFFER | CL BUFF | deletes all lines |
DEL | (none) | deletes the current line |
DEL n | (none) | deletes line n |
DEL * | (none) | deletes the current line |
DEL n * | (none) | deletes line n through the current line |
DEL LAST | (none) | deletes the last line |
DEL m n | (none) | deletes a range of lines (m to n) |
DEL * n | (none) | deletes the current line through line n |
INPUT | I | adds one or more lines |
INPUT text | I text | adds a line consisting of text |
LIST | L | lists all lines in the SQL buffer |
LIST n | L n or n | lists line n |
LIST * | L * | lists the current line |
LIST n * | L n * | lists line n through the current line |
LIST LAST | L LAST | lists the last line |
LIST m n | L m n | lists a range of lines (m to n) |
LIST * n | L * n | lists the current line through line n |
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/207/viewspace-815983/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SQL*Plus的行編輯命令(轉)SQL
- 使用sql*plus編輯sql文字SQL
- 【SQL*Plus】使用EDIT命令快速編輯指令碼檔案SQL指令碼
- 在shell中執行SQL*Plus命令SQL
- SQL*PLUS命令, set命令大全SQL
- sql_plus操作命令SQL
- 常用的sql*plus命令:SQL
- 【sqlplus】SQL*Plus命令使用大全SQL
- sql plus命令使用總結SQL
- SQL/PLUS 常用命令SQL
- sql*plus 常用命令SQL
- SQL/PLUS命令的使用大全SQL
- SQL*PLUS命令的使用大全SQL
- 詳解sql*plus spool命令SQL
- 【SQL*Plus】在SQL*Plus中謹慎使用Ctrl+S快捷鍵SQL
- SQL PLUS命令使用大全(轉,特有用)SQL
- 定製sql*plus的幾條命令SQL
- SQL*PLUS命令的使用大全(一)薦SQL
- SQL*PLUS命令的使用大全(zt)(轉)SQL
- SQL總結(四)編輯類SQL
- Oracle中SQL裡面的Help命令OracleSQL
- 1.3.3.5.1. SQL*Plus 連線命令語法SQL
- oracle實驗記錄 (SQL*PLUS 命令操作)OracleSQL
- 在sql*plus中顯示長字元SQL字元
- SQL語句大全,你需要的SQL在這裡SQL
- 【SQL*Plus】使用BREAK和COMPUTE在SQL*Plus中得到分組統計結果SQL
- Oracle SQL*PLUS基礎及sqlplus命令詳解 (轉)OracleSQL
- 使用SQL*PlusSQL
- ORACLE SQL and SQL*PLUS (strong recommend)OracleSQL
- sql之27 using sql*plusSQL
- sql之26 using sql*plusSQL
- SQL入門之6 sql*plusSQL
- sqlplus裡如何修改default的系統編輯器SQL
- monaco-editor 實現SQL編輯器SQL
- SQL*Plus安全(一)SQL
- SQL*Plus安全(二)SQL
- SQL*PLUS安全(三)SQL
- SQL*PLUS安全(四)SQL