Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reports- Supplement Queried Records with generated ones

Status
Not open for further replies.

slschneider

Programmer
Jan 13, 2005
2
US
We have a Report frame that consists of 60 fields organized in 3 columns by 20 rows. All of the fields must be filled in. If the corresponding Query returns 3 records to the Group, then we need to "pad" the remaining 57 fields with "*****". I've tried several approaches to this problem, centering around a union, with a select from dual based on the number of "real" records returned. A function returning a table of records sounded like a good idea, until I realized that I couldn't use it in an SQL statement "select..from DUAL". If I was writing in a conventional programming language, this would be no problem. I'm just not sure how to dynamically insert the generated records into the Group to get them to appear on the report. Any suggestions would be greatly appreciated!

Thanks,
Steve
 
Code:
select 
decode(a.field1,null,b.field1,a.field1) the_field 
from
(select [b]your_field[/b] field1, rownum field2 from [b]your_table[/b]) a
,
(select '*******' field1, rownum field2 from all_tables where rownum<61) b
where a.field2(+)=b.field2
___________________________________________________________________________
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top