dbTalk Databases Forums  

Report from SQL*Plus (multiple selects)

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Report from SQL*Plus (multiple selects) in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Collywobbles
 
Posts: n/a

Default Report from SQL*Plus (multiple selects) - 12-10-2004 , 09:14 AM






Is it possible to develop a report in SQL*Plus in a bill type format with
multiple selects?
I want to run a select to see my customers personal details and then to see
the orders they placed but it needs to be formatted with the customers
personal details at the top of each page and underneath list the order
details.
Thanks






Reply With Quote
  #2  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Report from SQL*Plus (multiple selects) - 12-10-2004 , 11:45 AM






Look up the BREAK, COMPUTE, and title commands.

HTH
ed


Reply With Quote
  #3  
Old   
Collywobbles
 
Posts: n/a

Default Re: Report from SQL*Plus (multiple selects) - 12-11-2004 , 03:41 AM




"Ed Prochak" <ed.prochak (AT) magicinterface (DOT) com> wrote

Quote:
Look up the BREAK, COMPUTE, and title commands.

but if I run the 1st select (on customers) it lists this table before it
considers listing the 2nd table




Reply With Quote
  #4  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Report from SQL*Plus (multiple selects) - 12-13-2004 , 04:31 PM



then make a join

SELECT <columns of interest>
FROM tableA, tableB
WHERE
GROUP BY

Like I said, look up BREAK and COMPUTE.
Your manual should have a few examples.


Reply With Quote
  #5  
Old   
Mark C. Stock
 
Posts: n/a

Default Re: Report from SQL*Plus (multiple selects) - 12-13-2004 , 07:03 PM




"Collywobbles" <spam (AT) spammer (DOT) spam> wrote

Quote:
Is it possible to develop a report in SQL*Plus in a bill type format with
multiple selects?
I want to run a select to see my customers personal details and then to
see
the orders they placed but it needs to be formatted with the customers
personal details at the top of each page and underneath list the order
details.
Thanks


even though some have suggested looking into BREAK and COMPUTE, in actuality
the format you are describing is beyond SQL*Plus's capabilities. You could
coerce the output into something close to an invoice/order format --
typically this involves unions and clever use of SQL*Plus column formatting
(NOPRINT) and concatenation -- but we used to do that when we didn't have
any other options. better you look into using an actual report writer for
this type of output.

++ mcs




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.