@@ -22,7 +22,7 @@ create or replace package ut_utils authid definer is
2222
2323 */
2424
25- gc_version constant varchar2(50) := 'utPLSQL - Version X.X.X.X';
25+ gc_version constant varchar2(50) := 'X.X.X.X';
2626
2727 /* Constants: Event names */
2828 gc_run constant varchar2(12) := 'run';
@@ -85,6 +85,10 @@ create or replace package ut_utils authid definer is
8585 gc_some_tests_failed constant pls_integer := -20213;
8686 pragma exception_init(ex_some_tests_failed, -20213);
8787
88+ -- Any of tests failed
89+ ex_invalid_version_no exception;
90+ gc_invalid_version_no constant pls_integer := -20214;
91+ pragma exception_init(ex_invalid_version_no, -20214);
8892
8993 gc_max_storage_varchar2_len constant integer := 4000;
9094 gc_max_output_string_length constant integer := 4000;
@@ -96,6 +100,15 @@ create or replace package ut_utils authid definer is
96100 gc_timestamp_format constant varchar2(100) := 'yyyy-mm-dd"T"hh24:mi:ssxff';
97101 gc_timestamp_tz_format constant varchar2(100) := 'yyyy-mm-dd"T"hh24:mi:ssxff tzh:tzm';
98102 gc_null_string constant varchar2(4) := 'NULL';
103+
104+ type t_version is record(
105+ major natural,
106+ minor natural,
107+ bugfix natural,
108+ build natural
109+ );
110+
111+
99112 /*
100113 Function: test_result_to_char
101114 returns a string representation of a test_result.
@@ -218,12 +231,12 @@ create or replace package ut_utils authid definer is
218231 procedure append_to_clob(a_src_clob in out nocopy clob, a_new_data varchar2);
219232
220233 function convert_collection(a_collection ut_varchar2_list) return ut_varchar2_rows;
221-
234+
222235 /**
223236 * Set session's action and module using dbms_application_info
224237 */
225238 procedure set_action(a_text in varchar2);
226-
239+
227240 /**
228241 * Set session's client info using dbms_application_info
229242 */
@@ -235,5 +248,14 @@ create or replace package ut_utils authid definer is
235248
236249 procedure cleanup_temp_tables;
237250
251+ /**
252+ * Converts version string into version record
253+ *
254+ * @param a_version_no string representation of version in format vX.X.X.X where X is a positive integer
255+ * @return t_version record with up to four positive numbers containing version
256+ * @throws 20214 if passed version string is not matching version pattern
257+ */
258+ function to_version(a_version_no varchar2) return t_version;
259+
238260end ut_utils;
239261/
0 commit comments