Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

using analytic functions in pl/sql

15495May 21 2002
Can you use analytic functions such as ratio_to_report and rank in a PL/SQL function? the following statement that works from my oracle client will not compile inside of a pl/sql block.

select
answer_key as investor_style,
count(distinct fe.business_id) curr,
ratio_to_report(count(distinct fe.business_id)) over()
from
demographics d,
formal_entities fe
where d.owner_key_num = fe.key_num
and d.owner_prof_name = 'CC_BUSINESS_FRML_FE_PROF'
and d.prof_name = 'TSC_CC_DEMOGRAPHIC_DE_PROF'
and d.question_key = 'INVESTING_STYLE'
and fe.tsc_registration_date >= trunc(fDate)
and fe.tsc_registration_date < trunc(tDate)
group by answer_key

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2002
Added on May 21 2002
4 comments
248 views