forked from doberkofler/PLSQL-JSON
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson_array.tps
More file actions
33 lines (28 loc) · 1.58 KB
/
json_array.tps
File metadata and controls
33 lines (28 loc) · 1.58 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
CREATE OR REPLACE
TYPE json_array IS OBJECT
(
nodes json_nodes, -- list of nodes
lastID NUMBER, -- id of the last node in this (not sub objects) object
-- Constructors
CONSTRUCTOR FUNCTION json_array(self IN OUT NOCOPY json_array) RETURN self AS result,
CONSTRUCTOR FUNCTION json_array(SELF IN OUT NOCOPY json_array, theData IN json_value) RETURN SELF AS result,
CONSTRUCTOR FUNCTION json_array(SELF IN OUT NOCOPY json_array, theJSONString IN CLOB) RETURN SELF AS result,
-- Member setter methods
MEMBER PROCEDURE append(self IN OUT NOCOPY json_array),
MEMBER PROCEDURE append(self IN OUT NOCOPY json_array, theValue IN VARCHAR2),
MEMBER PROCEDURE append(self IN OUT NOCOPY json_array, theValue IN NUMBER),
MEMBER PROCEDURE append(self IN OUT NOCOPY json_array, theValue IN DATE),
MEMBER PROCEDURE append(self IN OUT NOCOPY json_array, theValue IN BOOLEAN),
MEMBER PROCEDURE append(self IN OUT NOCOPY json_array, theValue IN json_object),
MEMBER PROCEDURE append(self IN OUT NOCOPY json_array, theValue IN json_array),
-- Member getter methods
MEMBER FUNCTION count(SELF IN json_array) RETURN NUMBER,
MEMBER FUNCTION get(SELF IN json_array, thePropertyIndex IN NUMBER) RETURN json_value,
MEMBER FUNCTION exist(SELF IN json_array, thePropertyIndex IN NUMBER) RETURN BOOLEAN,
-- Member convertion methods
MEMBER FUNCTION to_json_value(self IN json_array) RETURN json_value,
-- Output methods
MEMBER PROCEDURE to_clob(SELF IN json_array, theLobBuf IN OUT NOCOPY CLOB, theEraseLob BOOLEAN DEFAULT TRUE),
MEMBER PROCEDURE htp(SELF IN json_array, theJSONP IN VARCHAR2 DEFAULT NULL)
);
/