Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> A stored query?
I have this query in which I am trying to figure out the best way to
get a result set for my application.
I really want to be able to call a query, function, etc and pass it
three values and get a result set back. Before I was using views to
simplify my sql statements because I am using a ORM framework to
interface with the db.
I think I am having a hard time putting this into a view or trying to grasp the best way to do this. is there a such thing as a stored query? I don't think my ORM will let me call Oracle functions.
select origin, sum(revenue), trans_dt from revenue
where
origin in(
select ORIGIN from SPLIT_ORIGIN_ASSIGNMENT
where EFFECTIVE_DT <= '31-AUG-07' and EXPIRATION_DT >= '31-AUG-07')
AND kiac_acct_nbr not in
(select distinct KIAC_ACCT_NBR from aff_kiac_acct_alignment where
EFFECTIVE_DT <= '31-AUG-07' and EXPIRATION_DT >= '31-AUG-07')
AND
GET_QTR_BY_DATE(TRANS_DT) = 1 and
GET_YEAR_BY_DATE(TRANS_DT) = 2007
group by
origin, trans_dt
Received on Thu Aug 30 2007 - 09:16:33 CDT
![]() |
![]() |