Skip to Main Content

APEX

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Cursor Sql

Vinod NagarajMay 6 2025 — edited May 7 2025

Hello,

I am working on Report using AOP and need a Cursor query for which I am need help.

Below is the query I have

select 'file1' as "filename",
cursor(select
cursor(select a.fy, d.modecode_1_desc area_desc, a.location, d.modecode_2_desc loc_desc, e.soft_name_curr soft_name,
sum(b.quantity) quantity, sum(b.quantity*c.projected_cost) cost
from software_request_v a, software_request_dtl b, software_lic c, ref_modecode_slim_v d, ref_software e
where a.REQUEST_ID = b.REQUEST_ID
and a.soft_seq = c.soft_seq and a.soft_type = c.soft_type
and a.fy = c.fy
and a.batch_no = c.batch_no and c.soft_seq = e.soft_seq
and a.mc_1 = d.MODECODE_1 and a.mc_2 = d.MODECODE_2
and a.mc_3 = d.MODECODE_3 and a.mc_4 = d.MODECODE_4
and a.status_code in ('P')
and a.location = 5010 and a.fy=2024
group by a.fy, d.modecode_1_desc, a.location, d.modecode_2_desc, e.soft_name_curr
order by location, soft_name) as "CostSummary"
from dual) as "data"
from dual

The output of the above query is as below

BUT I need the output as below

Basically need to come up with Report like below with Totals

Any help is appreciated

This post has been answered by Vinod Nagaraj on May 9 2025
Jump to Answer
Comments
Post Details
Added on May 6 2025
1 comment
78 views