Merge DB34a changes

svn path=/Database/trunk/; revision=39197
This commit is contained in:
Jos Groot Lipman
2018-09-25 13:05:48 +00:00
parent 9cb667f7e6
commit 969719ff4c

View File

@@ -7971,9 +7971,11 @@ AS
ctx DBMS_XMLGEN.ctxhandle;
l_str_pos INTEGER;
l_str_pos2 INTEGER;
l_str_pos3 INTEGER;
l_user_key NUMBER;
l_date1 VARCHAR2 (20);
l_date2 VARCHAR2 (20);
l_date2 VARCHAR2 (4000); -- extra lang omdat hij heel even l_extra_where ook bevat
l_extra_where VARCHAR2 (4000);
l_sql_str VARCHAR2 (4000);
l_cursor SYS_REFCURSOR;
BEGIN
@@ -7986,6 +7988,8 @@ AS
FROM fac_usrrap
WHERE fac_usrrap_key = p_key;
-- p_where is: user_key + "#" + dt1 + "#" + dt2
-- or: user_key + "#" + dt1 + "#" + dt2 + "#" + whereclause
l_str_pos :=
INSTR (p_where,
'#',
@@ -8000,23 +8004,50 @@ AS
l_date1 :=
SUBSTR (p_where, l_str_pos + 1, l_str_pos2 - l_str_pos - 1);
l_date2 := SUBSTR (p_where, l_str_pos2 + 1);
l_extra_where := '';
l_str_pos3 :=
INSTR (p_where,
'#',
1,
3); -- 3nd occurence of #
IF (l_str_pos3 > 0) THEN
l_extra_where := SUBSTR (p_where, l_str_pos3 + 1);
l_date2 := SUBSTR (l_date2, 1, INSTR (l_date2, '#') - 1); -- Dan moet hier het where-clause stuk ook af
END IF;
-- All these reports are defined as
-- proc_name (user_key IN NUMBER, p_datum_van IN VARCHAR2, p_datum_tot IN VARCHAR2, p_cursor OUT t_cursor);
l_sql_str :=
'BEGIN '
|| proc_name
|| '('
|| l_user_key
|| ', '''
|| l_date1
|| ''', '''
|| l_date2
|| ''', '
|| ':l_outcursor'
|| '); END;';
--DBMS_OUTPUT.put_line (l_sql_str);
EXECUTE IMMEDIATE l_sql_str USING l_cursor;
-- or proc_name (user_key IN NUMBER, p_datum_van IN VARCHAR2, p_datum_tot IN VARCHAR2, p_cursor OUT t_cursor, p_where IN VARCHAR2);
if (l_extra_where IS NOT NULL)
THEN
l_sql_str :=
'BEGIN '
|| proc_name
|| '('
|| ' :l_user_key'
|| ', :l_date1'
|| ', :l_date2'
|| ', :l_outcursor'
|| ', :l_extrawhere '
|| '); END;';
EXECUTE IMMEDIATE l_sql_str USING l_user_key, l_date1, l_date2, l_cursor, l_extra_where;
ELSE
l_sql_str :=
'BEGIN '
|| proc_name
|| '('
|| l_user_key
|| ', '''
|| l_date1
|| ''', '''
|| l_date2
|| ''', '
|| ':l_outcursor'
|| '); END;';
-- DBMS_OUTPUT.put_line ('l_sql_str: ' || l_sql_str);
EXECUTE IMMEDIATE l_sql_str USING l_cursor;
END IF;
createopentagattributes ('rapport',
'view',