Fix for empty parameter name
This commit is contained in:
parent
2b6d76bb81
commit
d2e71075ef
@ -345,7 +345,6 @@ as
|
|||||||
l_temp_str t_max_pl_varchar2;
|
l_temp_str t_max_pl_varchar2;
|
||||||
l_begin_pos pls_integer;
|
l_begin_pos pls_integer;
|
||||||
l_end_pos pls_integer;
|
l_end_pos pls_integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
|
|
||||||
@ -359,33 +358,38 @@ begin
|
|||||||
Who Date Description
|
Who Date Description
|
||||||
------ ---------- -------------------------------------
|
------ ---------- -------------------------------------
|
||||||
MBR 16.05.2007 Created
|
MBR 16.05.2007 Created
|
||||||
|
MBR 24.09.2015 If parameter name not specified (null), then return null
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
-- get the starting position of the param name
|
if p_param_name is not null then
|
||||||
l_begin_pos:=instr(p_param_string, p_param_name || p_value_separator);
|
|
||||||
|
|
||||||
if l_begin_pos = 0 then
|
-- get the starting position of the param name
|
||||||
l_returnvalue:=null;
|
l_begin_pos:=instr(p_param_string, p_param_name || p_value_separator);
|
||||||
else
|
|
||||||
|
|
||||||
-- trim off characters before param value begins, including param name
|
if l_begin_pos = 0 then
|
||||||
l_temp_str:=substr(p_param_string, l_begin_pos, length(p_param_string) - l_begin_pos + 1);
|
l_returnvalue:=null;
|
||||||
l_temp_str:=del_str(l_temp_str, 1, length(p_param_name || p_value_separator));
|
|
||||||
|
|
||||||
-- now find the first next occurence of the character delimiting the params
|
|
||||||
-- if delimiter not found, return the rest of the string
|
|
||||||
|
|
||||||
l_end_pos:=instr(l_temp_str, p_param_separator);
|
|
||||||
if l_end_pos = 0 then
|
|
||||||
l_end_pos:=length(l_temp_str);
|
|
||||||
else
|
else
|
||||||
-- strip off delimiter
|
|
||||||
l_end_pos:=l_end_pos - 1;
|
|
||||||
end if;
|
|
||||||
|
|
||||||
-- retrieve the value
|
-- trim off characters before param value begins, including param name
|
||||||
l_returnvalue:=copy_str(l_temp_str, 1, l_end_pos);
|
l_temp_str:=substr(p_param_string, l_begin_pos, length(p_param_string) - l_begin_pos + 1);
|
||||||
|
l_temp_str:=del_str(l_temp_str, 1, length(p_param_name || p_value_separator));
|
||||||
|
|
||||||
|
-- now find the first next occurence of the character delimiting the params
|
||||||
|
-- if delimiter not found, return the rest of the string
|
||||||
|
|
||||||
|
l_end_pos:=instr(l_temp_str, p_param_separator);
|
||||||
|
if l_end_pos = 0 then
|
||||||
|
l_end_pos:=length(l_temp_str);
|
||||||
|
else
|
||||||
|
-- strip off delimiter
|
||||||
|
l_end_pos:=l_end_pos - 1;
|
||||||
|
end if;
|
||||||
|
|
||||||
|
-- retrieve the value
|
||||||
|
l_returnvalue:=copy_str(l_temp_str, 1, l_end_pos);
|
||||||
|
|
||||||
|
end if;
|
||||||
|
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user