forked from mortenbra/alexandria-plsql-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql_builder_pkg.pks
More file actions
executable file
·57 lines (41 loc) · 1.55 KB
/
Copy pathsql_builder_pkg.pks
File metadata and controls
executable file
·57 lines (41 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
create or replace package sql_builder_pkg
as
/*
Purpose: Package helps construct SQL statements
Remarks:
Who Date Description
------ ---------- -------------------------------------
MBR 01.01.2008 Created
*/
type t_query is record (
f_select string_util_pkg.t_max_pl_varchar2,
f_from string_util_pkg.t_max_pl_varchar2,
f_where string_util_pkg.t_max_pl_varchar2,
f_group_by string_util_pkg.t_max_pl_varchar2,
f_order_by string_util_pkg.t_max_pl_varchar2
);
-- set from list
procedure set_from (p_query in out t_query,
p_name in varchar2);
-- add to select list
procedure add_select (p_query in out t_query,
p_name in varchar2);
-- add to from list
procedure add_from (p_query in out t_query,
p_name in varchar2);
-- add to where list
procedure add_where (p_query in out t_query,
p_name in varchar2);
-- add to group by list
procedure add_group_by (p_query in out t_query,
p_name in varchar2);
-- add to order by list
procedure add_order_by (p_query in out t_query,
p_name in varchar2);
-- get SQL text
function get_sql (p_query in t_query,
p_include_where in boolean := true,
p_include_group_by in boolean := true,
p_include_order_by in boolean := true) return varchar2;
end sql_builder_pkg;
/