This is my report query:
Code:
SELECT sp.name, sp.acct_num, count(s.reg_num), count(c.claim_num), count(c.claim_num)/count(s.reg_num) as Ratio,
SUM(s.act_line_haul_amt)
FROM shipment_people sp, shipment s, claims c
WHERE sp.s_reg_num = c.reg_num(+)
AND sp.acct_num IN

(Select account_num
from active_driver_agents)

AND sp.s_reg_num = s.reg_num
AND sp.acct_num between :P_From_Acctnum and :P_To_Acctnum
AND s.act_load_date between :P_From_Date and :P_To_Date
GROUP BY sp.name, sp.acct_num
ORDER BY sp.acct_num
Look at the sub select, thats where I want to use my pl/sql table. I also read you can only use Varray in your SQL and not pl/sql tables. But the problem with VARRAYS you have to predefine the size. In my case, my for loop will change unless I do the count and use that to set the size of VARRAY. But that's another issue. You might be able to help me out with what we have right now. Thanks.