Tough SQL*Plus question [message #372226] |
Fri, 19 January 2001 12:56 |
Jim K.
Messages: 4 Registered: January 2001
|
Junior Member |
|
|
Please help:
Here is a dump of my typing in SQL*PLUS:
SQL> ttitle left 'Jim is cool'
SQL> select 'x' from dual;
Jim is cool
'
-
x
1 row selected.
SQL> select 'x' from dual minus select 'x' from dual;
no rows selected
In the second SELECT above, no rows were selected, so the title 'Jim is cool' did not print??? I would like in a report that I am building to always print the page title - even when no rows are found by the query! Any one know how to accomplish this in SQL*PLUS?
|
|
|
|
Re: Tough SQL*Plus question [message #372242 is a reply to message #372226] |
Mon, 22 January 2001 07:58 |
me
Messages: 66 Registered: August 2000
|
Member |
|
|
Perform a select you know will return a row.
ie: Sysdate into a no print column
column sdate noprint
ttitle left 'Jim is cool'
select sysdate sdate from dual;
select 'x' from dual minus select 'x' from dual;
|
|
|
Re: Tough SQL*Plus question [message #372243 is a reply to message #372226] |
Mon, 22 January 2001 08:11 |
Jim K.
Messages: 4 Registered: January 2001
|
Junior Member |
|
|
That would work great - however - the second query above always returns NULL. The one I am working with will return rows sometimes - so if I used your suggestion, and rows are returned by the second query, then two pages would print... each with a title.
In summary, I have Query A, that will return rows sometimes. I want the title to appear regaurdless, and the 'no rows selected' line to appear also, if there are no rows returned...
This is a toughie.
|
|
|
|
Re: Tough SQL*Plus question [message #372248 is a reply to message #372226] |
Mon, 22 January 2001 08:52 |
Jim K.
Messages: 4 Registered: January 2001
|
Junior Member |
|
|
Yes, I've thought of that ... But then the '1 row selected' message would appear if the main query returns nothing, instead of what the user wants 'no rows selected' and the title ...
Thanks for the idea !
|
|
|
|
|