Printing buffer's content in Command Window

Ivan C.

Member³
Is there a way to print the content of the buffer in a Command Window?

I tried the SQL*Plus LIST command, but it doesn't work.
I know I can open the editor and check it. That however is not helping if I need to repeatedly modify the SQL and run it. I don't know what were the previous versions of the SQL.

In SQL*Plus, after modifying the buffer in the editor, saving it, and closing the editor, SQL*Plus displays the content of the buffer on the screen. PL/SQL Developer, on the other hand, doesn't do that.

Could this, please, be added to the list of enhancements?
 
The edit command will show the most recently executed statement. You can edit it and subsequently enter / to execute it.
 
Instead of using the buffer you might better want to use the "Editor" tab of the "Command Window". You can print from there.
A workaround to see the buffer in the "Dialog" window would be to make the buffer content invalid on purpose, i.e. by adding a ";" at the end of your query in the "Text editor" window opened by EDIT. When you go back to the "Dialog" window then and try executing your query with R[UN], the whole content is displayed.
 
Well, the entire purpose of this is to make it all work, not cause a failure (by introducing a syntax error) just to display the content of the buffer in Command Window, then fix it, then run the statement again...
That would defeat the purpose (IMHO)

Marco,
Here's what I mean (steps):
1. Type a SQL query in Command Window at the prompt and execute it.
2. Type EDIT to open the Text (buffer) Editor. Modify the SQL, then close the editor. You'll get back to the prompt. The content of the buffer (SQL) is not displayed.
3. Execute, by entering /
4. Type EDIT again to go into the Text Editor. Modify the SQL again, close the editor.

At this point, there's no way I can get to the SQL modified in step 2 above (It may be available in Recall Statements, but would require extra clicking, searching, etc.)
 
I open a Command Window and type:

SQL> select 1 from dual;

Now I type EDIT, which opens an editor with "select 1 from dual". I change the text to "select 2 from dual" and press OK. I type / to execute it. Now I type EDIT again and see the latest "select 2 from dual". If I want to see the original "select 1 from dual" again I would need to press the "Previous" button or Ctrl-Up.
 
I guess it wouldn't hurt to implement the LIST functionality from SQL*Plus in a "Command Window".
Ivan C. probably just doesn't like the fact that you can never see your SQL and its result in one screen at the same time, which makes it cumbersome for printing, copy-pasting and things like that.
 
Bernhard,
Thank you. Yes, that's was exactly what I'm hoping for.

Marco,
Thank you for pointing out that Text Editor window has an Up/Down arrow.
I didn't realize that.... That'll do for now.
 
Back
Top