if case not always working
Posted: 17 Aug 2022 03:28
Code: Select all
if %lower_prefix_log_with_datetime%==yes (SET second_stg_rman_log_trc_prefix=%source_host_db%_%log_datetime%_%partial_rman_script_log_prefix%) else (SET second_stg_rman_log_trc_prefix=%partial_rman_script_log_prefix%_%source_host_db%_%log_datetime%)
echo second_stg_rman_log_trc_prefix %second_stg_rman_log_trc_prefix%
echo lower_comp_prefix_with_rman_arg %lower_comp_prefix_with_rman_arg%
SET initial_rman_log_trc_prefix=
echo initial_rman_log_trc_prefix %initial_rman_log_trc_prefix%
REM exit /B
if %lower_comp_prefix_with_rman_arg%==yes(SET initial_rman_log_trc_prefix="2nd_delcampo") else (SET initial_rman_log_trc_prefix="2nd_abcdef")
REM SET initial_rman_log_trc_prefix=%first_rman_arg%_%second_rman_arg%_%third_rman_arg%_%second_stg_rman_log_trc_prefix%
echo second lower_comp_prefix_with_rman_arg %lower_comp_prefix_with_rman_arg%
echo second initial_rman_log_trc_prefix %initial_rman_log_trc_prefix%
Code: Select all
C:\Users\lzhlzh>echo second_stg_rman_log_trc_prefix lap63-sin_wcdb_20220817_172222_set_scn_scn_number
second_stg_rman_log_trc_prefix lap63-sin_wcdb_20220817_172222_set_scn_scn_number
C:\Users\lzhlzh>echo lower_comp_prefix_with_rman_arg yes
lower_comp_prefix_with_rman_arg yes
C:\Users\lzhlzh>SET initial_rman_log_trc_prefix=
C:\Users\lzhlzh>echo initial_rman_log_trc_prefix
initial_rman_log_trc_prefix
C:\Users\lzhlzh>REM exit /B
C:\Users\lzhlzh>if yes == yes(SET initial_rman_log_trc_prefix="2nd_delcampo") else (SET initial_rman_log_trc_prefix="2nd_abcdef")
C:\Users\lzhlzh>REM SET initial_rman_log_trc_prefix=one_two_three_lap63-sin_wcdb_20220817_172222_set_scn_scn_number
C:\Users\lzhlzh>echo second lower_comp_prefix_with_rman_arg yes
second lower_comp_prefix_with_rman_arg yes
C:\Users\lzhlzh>echo second initial_rman_log_trc_prefix
second initial_rman_log_trc_prefix
C:\Users\lzhlzh>exit /B
it sets second_stg_rman_log_trc_prefix lap63-sin_wcdb_20220817_172222_set_scn_scn_number
but my second if statement look like it never really run
it is supposed to set initial_rman_log_trc_prefix="2nd_delcampo"
but it never sets. Instead it is back to "" .an empty string
any insight will be greatly appreciated. many thanks in advance