Skip to Main Content

SQL & PL/SQL

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!

CASE Statement with Oracle Table Types and EXISTS

KunalAug 13 2012 — edited Aug 15 2012
Hi Everyone,

I have been trying to use case statements with oracle table type by really not sure how to go about it. I know it might be simple but it been giving me hard time. So please help gurus :-)

Here is my Cursor:
CURSOR c_chk_style IS
      SELECT DISTINCT 1
        FROM TABLE(CAST(I_message.ExtOfXOrderDesc_TBL(1).ExtOfXOrderSkuDesc_TBL AS "RIB_ExtOfXOrderSkuDesc_TBL")) item_diff,
             TABLE(CAST(I_message.ExtOfXOrderDesc_TBL(1).ExtOfXOrderPackDesc_TBL AS "RIB_ExtOfXOrderPackDesc_TBL")) pack_diff
       WHERE (EXISTS (SELECT 1
                           FROM item_master im
                          WHERE im.item = item_diff.style_no
                            AND im.item_level=1)
              OR
              EXISTS (SELECT 1
                           FROM item_master im
                          WHERE im.item = pack_diff.style_no
                            AND im.item_level=1)
              );
Now i know that the table type "RIB_ExtOfXOrderSkuDesc_TBL" will be always populated but the table type "RIB_ExtOfXOrderPackDesc_TBL" may not be populate and can be null. So i want to run the exists against the "RIB_ExtOfXOrderPackDesc_TBL" aliased pack_diff only if it is populated. If its null i dont want to run the exists clause. Could anyone please help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 12 2012
Added on Aug 13 2012
15 comments
1,627 views