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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in DENSE_RANK() in using CURSOR in PK.

Status
Not open for further replies.

JPCogAdmin

Programmer
May 22, 2006
110
US
I get an error when trying to issue the following simple query. I'm using a cursor and an inline view and using the analytic function DENSE_RANK() over(). It's complaining about following error:

Error(32,8): PLS-00103: Encountered the symbol "GOT" when expecting one of the following: := . ( @ % ;


Error(34,136): PLS-00103: Encountered the symbol "(" when expecting one of the following: , from

code looks like this:

**********************************************************
cursor got is
'select t.name, t.calls, t.TMIN,t.MINS,t.Ranking
from ( select name, count(*) calls,sum(num_calls) TMIN, to_char((count(*)/sum(num_calls)),'999999') MINS, DENSE_RANK() over (order by count(*) desc) Ranking from table1 group by name) T
where Ranking<=10';
**********************************************************

Does someone know how to fix the problem? Ii, read on google that previous versions of Oracle ie. 8i,9i has problems with the DENSE_RANK() function. Now, I wonder if that's still the same with Oracle 10G V.2 (mine). Thanks for any solution you might provide.

-JP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top