Skip to Content

4 Comments

You must be Logged on to comment or reply to a post.

  1. Dirk Venken

    There’s no need for an if-then-else structure in the script to select the source file. You can get the same reults in 2 lines only:

         $G_File_Option = init_cap( nvl($G_File_Option, ‘ALL’));

         $G_File_Name = ‘Employee_Grade_’||$G_File_Option||’.xlsx’;

    (0) 
    1. Sagar Girme Post author

      Yes, agree. In this case it is not necessary.

      But in case if we have options like 1,2,3 etc. then we can have if-then-else

      If ($G_File_Option=1)

      $G_File_Name = ‘Employee_Grade_Pune.xlsx’;

      Else

           If ($G_File_Option=2)

           $G_File_Name = ‘Employee_Grade_Chennai.xlsx’;

           Else

                If ($G_File_Option=3)

                $G_File_Name = ‘Employee_Grade_London.xlsx’;

                Else

                $G_File_Name =’Employee_Grade_All.xlsx’;

      (0) 
      1. Dirk Venken

        Or in 1 line:

             $G_File_Name = ‘Employee_Grade_’||decode($G_File_Option=1,’Pune’,$G_File_Option=2,’Chennai’,$G_File_Option=3,’London’,’All’)||’.xlsx’;

        (0) 

Leave a Reply