and it prints the title 2 times, as expected:
WHENEVER SQLERROR CONTINUE ROLLBACK SPOOL &output_folder\fubar.lst TTITLE CENTER "***** Testing TTITLE *****" SKIP 2 PROMPT ===== Statement #1 works ===== SELECT * FROM scott.dept; PROMPT ===== Statement #2 fails ===== SELECT firbolig FROM scott.dept; PROMPT ===== Statement #3 works ===== SELECT SYSDATE FROM dual; SPOOL OFF
===== Statement #1 works ===== ***** Testing TTITLE ***** DEPTNO DNAME LOC ------ -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON ===== Statement #2 fails ===== SELECT firbolig * ERROR at line 1: ORA-00904: "FIRBOLIG": invalid identifier Rollback complete. ===== Statement #3 works ===== ***** Testing TTITLE ***** SYSDATE ----------- 12-Mar-2012
user11184124 wrote:I don't think "WHENEVER SQLERROR ..." has anything to do with TTITLE. Post a script that shows what you think is the relationship.
Could you please help me understand rationally - what "Whenever SqlError ..." to do with TTITLE ?
Is TTITLE a sql statement ?No, it's a SQL*Plus statement. Whenever you want to know if something is a SQL statement or not, look it up in the SQL language manual.
Isn't it expected that TTITLE will do it's job that is prinitng one time and let "Whenever SqlError ..." take care of sql statements and do it's job ?Yes, that's what I expect, and, as I said before, that seems to be exactly what it's doing. If there's something you don't understand about TITTLE, or about WHENEVER SQLERROR, or about both together, then post an script that people can run to see exactly what you mean.
user11184124 wrote:TTITLE was designed to print automatically with query results. If you want something that prints when you tell it to, then don't use TTITLE.
... In nut shell -
I expect TTITLE to print just once what it's asked to, whether sql statement(s) fail or succeed. Is this possible ?