Home » Other » Client Tools » SQLPLUS Report with multiple queries
SQLPLUS Report with multiple queries [message #259171] Tue, 14 August 2007 10:02 Go to next message
lykmyk
Messages: 9
Registered: March 2007
Junior Member
Hello Experts:

I am writing a SQLPlus report that will have two seperate queries. The first query is a summary while the second query contains detail information. Example:

SPOOL rep.txt
select SUM(a.col1) FROM test_tab;
select a.col1,a.col2,a.col3 FROM test_tab;
SPOOL OFF

After the report runs, the second query starts on a new page.

Here are my questions:

#1) How can i get the second query to start on the same page immediately after the first query.

#2) I would like to give each query a "sub_title". I am using REPHEADER now, but i suspect that may be forcing the second query to start on a new page.

Thanks for your help.
Re: SQLPLUS Report with multiple queries [message #259207 is a reply to message #259171] Tue, 14 August 2007 11:44 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
1) set newpage none
2) repheader implies a new page for each statement

Regards
Michel
Re: SQLPLUS Report with multiple queries [message #259225 is a reply to message #259207] Tue, 14 August 2007 14:51 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Try using PROMPT between the 2 queries to print extra text. Of course it won't repeat per page break. The SQLplus example reports show most of the formatting possibilities. An obsecure way to really customize report layout is to populate a pl/sql table (or table) from pl/sql with the exact formatted text per line that you want - then just select the contents of that for the final result.
Previous Topic: sqlplus, how to send error messages to stdout when set feedback is off and spooling to file
Next Topic: output formatting
Goto Forum:
  


Current Time: Sun Dec 22 17:05:56 CST 2024