Back to the sqlplus prompt

守給你的承諾、 提交于 2019-12-02 19:53:15

问题


I'm a beginner in PL/SQL, I'm trying some sql script but sometimes I have an error in my script and the prompt doesn't appear; I remain in input mode.

How can I retrieve the prompt without shutting down the terminal?

(p.s.: I used sql plus for oracle 11g under Ubuntu OS)


回答1:


From the documentation

SQL*Plus treats PL/SQL subprograms in the same manner as SQL commands, except that a semicolon (;) or a blank line does not terminate and execute a block. Terminate PL/SQL subprograms by entering a period (.) by itself on a new line. You can also terminate and execute a PL/SQL subprogram by entering a slash (/) by itself on a new line.

If you're entering a PL/SQL block and getting numbered prompts, enter a period (.) on its own and you'll drop back to the SQL> prompt.

SQL> declare
  2
  3
  4
  5  .
SQL>

The code you entered will still be in the buffer and you can run it with /, or edit it in your configured text editor with edit. (You can set that with define _editor = "/usr/bin/vim", for example).



来源:https://stackoverflow.com/questions/22791927/back-to-the-sqlplus-prompt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!