plsql: Fix readline/output async. Improve arg mode.
[jackhill/mal.git] / plsql / step1_read_print.sql
index 08107a7..4c5c6f4 100644 (file)
@@ -55,7 +55,9 @@ BEGIN
             END IF;
 
             EXCEPTION WHEN OTHERS THEN
-                IF SQLCODE = -20001 THEN  -- io streams closed
+                IF SQLCODE = -20001 THEN  -- io read stream closed
+                    stream_writeline('closing stream 1');
+                    io.close(1);  -- close output stream
                     RETURN 0;
                 END IF;
                 io.writeline('Error: ' || SQLERRM);