2 Replies Latest reply on Feb 28, 2019 9:30 PM by 3592655

    Sqlplus script on condition basis

    3592655

      Hi All,

       

      I wanted to achieve the below condition to an already existing SQLPLUS script which will be executed both on the 11i & R12 instances.

       

      --- Logic is, if the release is R12 then execute the COMPILE_R12.plbs file(used substitution variable to achieve that ) and ignore as NULL if it is an 11i instance.

      REM

      SET VERIFY OFF

      CLEAR BUFFER

      SET SERVEROUT ON

      WHENEVER SQLERROR EXIT

      SET NULL ""   ---- marking this to ignore the NULL

       

      column RELEASE_NAME new_value new_val

      SELECT

        CASE

          WHEN RELEASE_NAME like '11i%'

          THEN NULL                  ---------- which mean I do not want to compile anything

      WHEN RELEASE_NAME like 'R12%'

          THEN 'COMPILE_R12.plbs'

        END AS RELEASE_NAME

      FROM

        fnd_product_groups;

       

      @@&new_val   -- compiling the new_val retrieved and this should be ignored if the release is 11i, the logic fails here

       

      show errors

       

      PAUSE Press ENTER to continue...

      EXIT

       

      Any comments or pointers will be helpful.

       

      Thank you.