From d3af944d273b5a03fee92e04de2618807d8077eb Mon Sep 17 00:00:00 2001 From: Matthew Hasbach Date: Tue, 12 May 2015 17:50:06 -0400 Subject: [PATCH 1/6] string_util_pkg.str_to_bool_str now leverages string_util_pkg.str_to_bool in order to reduce code redundancy --- ora/string_util_pkg.pkb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ora/string_util_pkg.pkb b/ora/string_util_pkg.pkb index de009e6..028e4d8 100755 --- a/ora/string_util_pkg.pkb +++ b/ora/string_util_pkg.pkb @@ -694,10 +694,11 @@ begin Who Date Description ------ ---------- ------------------------------------- MBR 06.01.2009 Created + MJH 12.05.2015 Leverage string_util_pkg.str_to_bool in order to reduce code redundancy */ - if lower(p_str) in ('y', 'yes', 'true', '1') then + if str_to_bool(p_str) then l_returnvalue := g_yes; end if; From 01f129e2a58d051e3b1389ac7c0ce3a08345f240 Mon Sep 17 00:00:00 2001 From: Matthew Hasbach Date: Tue, 12 May 2015 17:37:29 -0400 Subject: [PATCH 2/6] Added string_util_pkg.is_str_alphanumeric --- ora/string_util_pkg.pkb | 22 ++++++++++++++++++++++ ora/string_util_pkg.pks | 3 +++ 2 files changed, 25 insertions(+) diff --git a/ora/string_util_pkg.pkb b/ora/string_util_pkg.pkb index de009e6..8c70058 100755 --- a/ora/string_util_pkg.pkb +++ b/ora/string_util_pkg.pkb @@ -487,6 +487,28 @@ begin end remove_non_alpha_chars; +function is_str_alphanumeric (p_str in varchar2) return boolean +as + l_returnvalue boolean; +begin + + /* + + Purpose: returns true if string is alphanumeric + + Who Date Description + ------ ---------- ------------------------------------- + MJH 12.05.2015 Created + + */ + + l_returnvalue := regexp_instr(p_str, '[^a-z|A-Z|0-9]') = 0; + + return l_returnvalue; + +end is_str_alphanumeric; + + function is_str_empty (p_str in varchar2) return boolean as l_returnvalue boolean; diff --git a/ora/string_util_pkg.pks b/ora/string_util_pkg.pks index 3fbc4db..a665e5d 100755 --- a/ora/string_util_pkg.pks +++ b/ora/string_util_pkg.pks @@ -92,6 +92,9 @@ as -- remove all non-alpha characters (A-Z) from string function remove_non_alpha_chars (p_str in varchar2) return varchar2; + -- returns true if string is alphanumeric + function is_str_alphanumeric (p_str in varchar2) return boolean; + -- returns true if string is "empty" (contains only whitespace characters) function is_str_empty (p_str in varchar2) return boolean; From 8e4a27db73372fde4dd1365da5dbd56e253750e7 Mon Sep 17 00:00:00 2001 From: Matthew Hasbach Date: Wed, 13 May 2015 18:00:45 -0400 Subject: [PATCH 3/6] Added string_util_pkg.is_str_alpha --- ora/string_util_pkg.pkb | 22 ++++++++++++++++++++++ ora/string_util_pkg.pks | 3 +++ 2 files changed, 25 insertions(+) diff --git a/ora/string_util_pkg.pkb b/ora/string_util_pkg.pkb index de009e6..9ba05ca 100755 --- a/ora/string_util_pkg.pkb +++ b/ora/string_util_pkg.pkb @@ -487,6 +487,28 @@ begin end remove_non_alpha_chars; +function is_str_alpha (p_str in varchar2) return boolean +as + l_returnvalue boolean; +begin + + /* + + Purpose: returns true if string only contains alpha characters + + Who Date Description + ------ ---------- ------------------------------------- + MJH 12.05.2015 Created + + */ + + l_returnvalue := regexp_instr(p_str, '[^a-z|A-Z]') = 0; + + return l_returnvalue; + +end is_str_alpha; + + function is_str_empty (p_str in varchar2) return boolean as l_returnvalue boolean; diff --git a/ora/string_util_pkg.pks b/ora/string_util_pkg.pks index 3fbc4db..62c0805 100755 --- a/ora/string_util_pkg.pks +++ b/ora/string_util_pkg.pks @@ -92,6 +92,9 @@ as -- remove all non-alpha characters (A-Z) from string function remove_non_alpha_chars (p_str in varchar2) return varchar2; + -- returns true if string only contains alpha characters + function is_str_alpha (p_str in varchar2) return boolean; + -- returns true if string is "empty" (contains only whitespace characters) function is_str_empty (p_str in varchar2) return boolean; From 8fdac96e663ee33dd638b901eaf10dc4f8db2a48 Mon Sep 17 00:00:00 2001 From: Matthew Hasbach Date: Tue, 12 May 2015 18:48:34 -0400 Subject: [PATCH 4/6] Added string_util_pkg.is_str_integer --- ora/string_util_pkg.pkb | 22 ++++++++++++++++++++++ ora/string_util_pkg.pks | 3 +++ 2 files changed, 25 insertions(+) diff --git a/ora/string_util_pkg.pkb b/ora/string_util_pkg.pkb index de009e6..2be224a 100755 --- a/ora/string_util_pkg.pkb +++ b/ora/string_util_pkg.pkb @@ -557,6 +557,28 @@ begin end is_str_number; +function is_str_integer (p_str in varchar2) return boolean +as + l_returnvalue boolean; +begin + + /* + + Purpose: returns true if string is an integer + + Who Date Description + ------ ---------- ------------------------------------- + MJH 12.05.2015 Created + + */ + + l_returnvalue := regexp_instr(p_str, '[^0-9]') = 0; + + return l_returnvalue; + +end is_str_integer; + + function short_str (p_str in varchar2, p_length in number, p_truncation_indicator in varchar2 := '...') return varchar2 diff --git a/ora/string_util_pkg.pks b/ora/string_util_pkg.pks index 3fbc4db..32561a9 100755 --- a/ora/string_util_pkg.pks +++ b/ora/string_util_pkg.pks @@ -100,6 +100,9 @@ as p_decimal_separator in varchar2 := null, p_thousand_separator in varchar2 := null) return boolean; + -- returns true if string is an integer + function is_str_integer (p_str in varchar2) return boolean; + -- returns substring and indicates if string has been truncated function short_str (p_str in varchar2, p_length in number, From 3643767bbc1dd02b0f823d379cc734fed5691104 Mon Sep 17 00:00:00 2001 From: Eric Olson Date: Sun, 24 May 2015 10:30:15 -0500 Subject: [PATCH 5/6] Get all nodes under Change XPath query to get all nodes under the node of interest, regardless of their depth. This concatenates the resulting text() nodes together. --- ora/ooxml_util_pkg.pkb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ora/ooxml_util_pkg.pkb b/ora/ooxml_util_pkg.pkb index 6cf17f5..97e7365 100755 --- a/ora/ooxml_util_pkg.pkb +++ b/ora/ooxml_util_pkg.pkb @@ -401,7 +401,7 @@ begin if l_type = 's' then l_string_index := to_number (l_returnvalue); l_xml := get_xml (p_xlsx, 'xl/sharedStrings.xml'); - l_returnvalue := xml_util_pkg.extract_value (l_xml, '/sst/si[' || (l_string_index + 1) || ']/t/text()', g_namespace_xlsx_sharedstrings); + l_returnvalue := xml_util_pkg.extract_value (l_xml, '/sst/si[' || (l_string_index + 1) || ']//t/text()', g_namespace_xlsx_sharedstrings); end if; return l_returnvalue; @@ -453,7 +453,7 @@ begin if l_type = 's' then l_string_index := to_number (l_returnvalue(i)); - l_returnvalue(i) := xml_util_pkg.extract_value (l_shared_strings, '/sst/si[' || (l_string_index + 1) || ']/t/text()', g_namespace_xlsx_sharedstrings); + l_returnvalue(i) := xml_util_pkg.extract_value (l_shared_strings, '/sst/si[' || (l_string_index + 1) || ']//t/text()', g_namespace_xlsx_sharedstrings); end if; end loop; From 6e4cd51dc65f1db458a8c62cb49898432c1738af Mon Sep 17 00:00:00 2001 From: mortenbra Date: Fri, 12 Jun 2015 11:07:58 +0200 Subject: [PATCH 6/6] PL/JSON moved from SourgeForge to GitHub --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d855fc..42dadd3 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ This library is a collection of various utility packages for PL/SQL, as well as ##Parse JSON using PL/SQL - * http://sourceforge.net/projects/pljson/ + * https://github.com/pljson/pljson * http://reseau.erasme.org/pl-sql-library-for-JSON?lang=en