Populate A Table Prior to Select [message #293974] |
Tue, 15 January 2008 16:54  |
michael2007
Messages: 6 Registered: January 2008
|
Junior Member |
|
|
Hopefully someone can give me a fix to a problem we encounter here at work frequently.
Our reporting application has a restriction that it can only accept a single select statement. This makes for a BIG select statement. I moved much of the code to a View and kept a simple select with the record key in the application. Unfortunately the view processes all records for a long time before returning the single key requested. I need the view to look at the one key only.
I was hoping that I could put a function in the report select statement that would cause a table to be loaded with the key and have the view join to this key table. Is something like this possible or is there a better way?
My idea goes something like this:
Report Application:
select *
from report_view a
where my_key_function(1000) = 0
my_key_function:
(loads key into key_table)
Report View:
select *
from report_data a
inner join key_table b
on b.key = a.key
Any help is greatly appreciated!
|
|
|
|
|
|
|