Skip navigation

plsql conditional compilation

score 10
You have not voted. Active

Hi all,

I would like to do the following using conditional compiling when the DB release_name is greater than 12.2.0 then a certain operation has to be performed, else not.
I use the below code, it always goes to the ELSE part of the IF condition. Also, I will not be able to use dbms_db_version.ver_le_12_2 , the reason is, I am looking for release_name(from fnd_product_groups table) which has to be equal to or greater than 12.2.0 and not the database version(from v$version). Any pointers or sample code would be appreciated.

 

BEGIN
    --get the current oracle release version
    SELECT release_name INTO ver_cust FROM fnd_product_groups;

    --convert customer oracle version to number
    num_version_c := to_number(REPLACE(ver_cust,'.',''));
FOR indx IN 1..abc_TBL.COUNT LOOP
          abc(indx).ADJUSTMENT_ID           := abc_TBL(indx).P_ADJUSTMENT_ID ;
          abc(indx).PHYSICAL_INVENTORY_ID   := abc_TBL(indx).P_PHYSICAL_INVENTORY_ID ;
          abc(indx).ORGANIZATION_ID         := abc_TBL(indx).P_ORGANIZATION_ID ;
          $IF ($$num_version_c>=1220) $THEN
            DBMS_OUTPUT.put_line('success part');
            abc(indx).APPROVED_BY_EMPLOYEE_ID := abc_TBL(indx).P_APPROVED_BY_EMPLOYEE_ID ;
   $ELSE
            dbms_output.put_line('fail');
          $END
         
          abc(indx).APPROVAL_STATUS         := abc_TBL(indx).P_APPROVAL_STATUS ;
        END LOOP;
END;

 

Thank you.

Comments

Vote history