Skip to Main Content

Oracle Database Discussions

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!

PL/SQL question

928295Apr 3 2012 — edited Apr 3 2012
I hope this is in the correct forum. I've recently begun pulling data from an Oracle database and am relatively new to PL/SQL. One of the datasets that I need to pull is based on a troubling join. I time out when trying to pull this data and am not sure if it is due to me writing the script in a bad way. I'd appreciate feedback on this- and apologize if this is the wrong place to ask this type of question on the forum.

The two fields that I need to join are TRIMMED_CUST_RELEASE = CASE_REF_NUM_PARSED.
I have no permission to create views, etc. in the database.

SELECT F_CUST_CORP_ID, F_CASE_ID, F_CASE_REF_NUM, CASE_REF_NUM_PARSED, CUST_RELEASE, TRIMMED_CUST_RELEASE

FROM (SELECT DW.T_DM_CASES_OPEN.F_CUST_CORP_ID, DW.T_DM_CASES_OPEN.F_CASE_ID, DW.T_DM_CASES_OPEN.F_CASE_REF_NUM, substr(DW.T_DM_CASES_OPEN.F_CASE_REF_NUM, 1, 6) AS CASE_REF_NUM_PARSED, DW.SALES_ORDER.CUST_RELEASE, LTRIM(RTRIM(DW.SALES_ORDER.CUST_RELEASE)) AS TRIMMED_CUST_RELEASE
FROM DW.T_DM_CASES_OPEN, DW.SALES_ORDER
WHERE (DW.T_DM_CASES_OPEN.F_CUST_CORP_ID = '209863') AND (DW.T_DM_CASES_OPEN.F_CASE_REF_NUM LIKE 'Q%')) S
WHERE (TRIMMED_CUST_RELEASE = CASE_REF_NUM_PARSED)

I'm new to PL/SQL, please be gentle.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2012
Added on Apr 3 2012
3 comments
42 views