Source files:
Define file format:
Simple Script to select particular source file runtime.
Passing value to Variable:
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';
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';
If ($G_File_Option=3)
$G_File_Name = 'Employee_Grade_London.xlsx';
$G_File_Name ='Employee_Grade_All.xlsx';
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';
Ultimately Decode and If-Then-Else doing same thing, one in single line and other in simplified way.
Enter the destination URL
Or link to existing content
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';
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';
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';
Ultimately Decode and If-Then-Else doing same thing, one in single line and other in simplified way.