How do you write a script to show query result in a way it scrolls on screen? On UNIX, `vmstat 2' shows VM/CPU stats one line every 2 seconds. Many tools do that. (`top' can also run in batch mode to do the same.) Is there a way to do the same with sqlplus? The challenge here is that sqlplus offers no facility to create a loop, while PL/SQL dbms_output.put_line always buffers the output till the end of executing PL/SQL code. PL/SQL utl_file can flush results. Without creating another process and if the Oracle client is on UNIX, the following code shows how to scroll the query result on screen: create directory testdir as '/dev/pts'; declare v_output_file utl_file.file_type; begin v_output_file := utl_file.fopen('TESTDIR', '0', 'a'); for i in 1..5 loop utl_file.put_line(v_output_file, 'Line '||i||': NATURE and Beauty'); utl_file.fflush(v_output_file); dbms_lock.sleep(1); end loop; utl_file.fclose_all; end; / The output "file" is named '0', because `tty` says my output window is /dev/pts/0. Alternatively, you could create the directory object testdir for just '/dev' and utl_file.fopen('TESTDIR, 'tty', 'a') so you don't need to know whether you're using pts 0 or 1 or 2. (Normally you can't fopen 'console' for append because /dev/console has permission 600 owned by root:root; allowing oracle to write or adding oracle to root group should work.) I plan to make use of the above code to build some practically useful, vmstat-like scripts. Comments: (1) I can't figure out how to achieve this on Windows. CON: is the current DOS window (you can't echo text to another DOS window). Although I can echo text to \con:, /con: or c:\con:, there's no directory for the pseudo file to live in. So I can't utl_file.put_line into a file named 'CON:' in the directory object I created earlier, regardless what physical directory I created on (I always get ORA-6510, PL/SQL: unhandled user-defined exception). (2) Another way to do this may be creating a ksh coprocess. Send a query in and read the output out and wrap this process in a loop.