Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> A stored query?

A stored query?

From: Anthony Smith <mrsmithq_at_hotmail.com>
Date: Thu, 30 Aug 2007 07:16:33 -0700
Message-ID: <1188483393.948942.143290@k79g2000hse.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US