PL/SQL and Crystal Reports Command very slow
Hi Everyone,
I realize this is a PL/SQL forum, but if anyone has an insight into this PL/SQL - Crystal Reports interaction, I'd appreciate it.
I wrote a command for my report that brings in 2 custom fields from our oracle DB. While everything works, the report is now dreadfully slow. It takes up to 15-20 seconds to pull 1 record at a time... this is a 28,000 record report.
Any advice is welcome. Here's the command:
SELECT
CAST(SY_KEY1 as INT) AS SRV_LOC_NBR,
(
SELECT SY_VALUE FROM SY_OPN_FLD_VALUE S2 WHERE S2.SY_OPEN_LBL = 'CT Type' AND S2.SY_KEY1 = S1.SY_KEY1
) CT_TYPE,
(
SELECT SY_VALUE FROM SY_OPN_FLD_VALUE S2 WHERE S2.SY_OPEN_LBL = 'PT Type' AND S2.SY_KEY1 = S1.SY_KEY1
) PT_TYPE
FROM
SY_OPN_FLD_VALUE S1
WHERE
SY_TBL_NAME = 'ServiceLoc'
GROUP BY
SY_KEY1