Answer the question
In order to leave comments, you need to log in
[SQLPLUS] How to get the number of returned rows?
I have a batch pipeline function called in SQLPLUS that writes the result (table) to a file.
I need to additionally count the number of returned rows, and if nothing is returned, then exit the script with an error code.
WHENEVER oserror exit 1;
WHENEVER sqlerror exit 2;
SET HEADING OFF
SET FEEDBACK OFF
SET PAGESIZE 0
SET ECHO OFF
SPOOL ./tmp/retTables.txt
SELECT * FROM TABLE(usr.util_pack.Get_List);
SPOOL OFF;
exit 0;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question