-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.sql
78 lines (70 loc) · 2.14 KB
/
tests.sql
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
--Testes de documento
select * from func_jsonmapeamento( 1::bigint ,
'{
"id":1,
"nome":"Maria",
"endereco":"R. Qualquer",
"escada": [{"1 andar" :"azul"},{"1 andar" :"vermelho"},{"1 andar" :
[{"2 andar":"verde"},{"2 andar":
[{"3 andar":"marrom"},{"3 andar":
[{"4 andar":"amarelo"}]}]}]}
]
}');
select * from func_jsonmapeamento( 1::bigint ,
'{
"resultset": {
"violations": {
"hpd": [
{
"0": {
"ViolationID": "110971",
"BuildingID": "775548",
"RegistrationID": "500590",
"Boro": "STATEN ISLAND",
"HouseNumber": "275",
"LowHouseNumber": "275",
"HighHouseNumber": "275",
"StreetName": "RICHMOND AVENUE",
"StreetCode": "44750",
"Zip": "10302",
"Apartment": "",
"Story": "All Stories ",
"Block": "1036",
"Lot": "1",
"Class": "A",
"InspectionDate": "1997-04-11",
"OriginalCertifyByDate": "1997-08-15",
"OriginalCorrectByDate": "1997-08-08",
"NewCertifyByDate": "",
"NewCorrectByDate": "",
"CertifiedDate": "",
"OrderNumber": "772",
"NOVID": "3370",
"NOVDescription": "§ 27-2098 ADM CODE FILE WITH THIS DEPARTMENT A REGISTRATION STATEMENT FOR BUILDING. ",
"NOVIssuedDate": "1997-04-22",
"CurrentStatus": "VIOLATION CLOSED",
"CurrentStatusDate": "2015-03-10"
},
"count": "1"
}
]
}
},
"count": "1",
"total_page": 1,
"current_page": 1,
"limit": [
"0",
"1000"
],
"status": "success",
"error_code": "",
"message": ""
}'
)
--Testes de operadores
select func_jsonmapeamento (2::bigint ,
'[{"array":"teste"},{"array2":"teste2"}]'
);
select '[{"array":"teste"},{"array2":"teste2"}]'== 'array';
select '[0,1]'=='array';