Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.89 KB | None | 0 0
  1. select j.*
  2. from json_table( '{
  3. "BLETest":
  4. [{
  5. "name": "Employee",
  6. "description": "Test Bluetooth Scan",
  7. "nbrscan": 2,
  8. "starttime": "31-07-2018 23:12:02",
  9. "scanperiodicity": 20,
  10. "scanduration": 15,
  11. "phoneidentifier": "undefined",
  12. "phonebrand": "Lenovo",
  13. "phonemodel": "P2",
  14. "requestedgpsaccuracy": "98" ,
  15.  
  16. "BLEScanList":
  17. [
  18. { "startwgs84longitude":"12.3456",
  19. "startwgs84latitude":"23.45678",
  20. "startgpsaccuracy":"23",
  21. "starttime":"06-07-2018 09:20:09",
  22. "stopwgs84longitude":"undefined",
  23. "stopwgs84latitude":"undefined",
  24. "stopgpsaccuracy":"undefined",
  25. "stoptime":"05-07-2017 09:20:29",
  26. "phonebatterylevel":77,
  27.  
  28. "BLEScanObjectList":[
  29. {"name":"BPUCK ID 000020","id":"C3:5E:45:15:70:C2","advertising":{},"rssi":-65},
  30. {"id":"60:F8:1D:BA:E0:43","advertising":{},"rssi":-71},
  31. {"name":"BPUCK ID 000015","id":"E8:3D:8F:B3:40:05","advertising":{},"rssi":-81},
  32. {"id":"F2:69:DC:5B:0B:17","advertising":{},"rssi":-70},
  33. {"name":"BPUCK ID 00002B","id":"DA:09:32:B9:87:D3","advertising":{},"rssi":-75},
  34. {"name":"BPUCK ID 00002D","id":"F9:45:D5:B1:6A:DD","advertising":{},"rssi":-67},
  35. {"id":"1D:F0:2A:48:28:1B","advertising":{},"rssi":-65},
  36. {"id":"07:C9:58:F2:32:EE","advertising":{},"rssi":-84},
  37. {"id":"2E:0C:91:FE:3D:C2","advertising":{},"rssi":-88},
  38. {"id":"2C:6B:0B:19:0A:27","advertising":{},"rssi":-91},
  39. {"id":"F1:61:22:84:29:12","advertising":{},"rssi":-92},
  40. {"id":"46:83:6B:62:22:1F","advertising":{},"rssi":-100},
  41. {"id":"4F:8F:8A:6E:52:49","advertising":{},"rssi":-82},
  42. {"id":"DA:C3:C4:13:0E:28","advertising":{},"rssi":-74},
  43. {"id":"01:25:24:3C:4A:7E","advertising":{},"rssi":-88},
  44. {"id":"78:4F:43:84:B3:67","advertising":{},"rssi":-87},
  45. {"id":"F1:68:DB:5A:0A:16","advertising":{},"rssi":-86},
  46. {"id":"E8:3F:3E:EF:F4:DA","advertising":{},"rssi":-83},
  47. {"id":"75:22:49:36:A8:D8","advertising":{},"rssi":-70},
  48. {"id":"1A:D5:86:5B:95:D4","advertising":{},"rssi":-90},
  49. {"id":"EF:5F:20:82:27:10","advertising":{},"rssi":-89},
  50. {"id":"E1:A4:21:BF:DD:9C","advertising":{},"rssi":-89},
  51. {"id":"26:A7:91:D8:58:02","advertising":{},"rssi":-97},
  52. {"id":"5D:5A:9E:49:15:AA","advertising":{},"rssi":-79},
  53. {"id":"F3:6A:DD:5C:0C:18","advertising":{},"rssi":-88},
  54. {"id":"D0:99:26:A7:F7:EB","advertising":{},"rssi":-77},
  55. {"id":"D0:A0:DF:7D:D8:EF","advertising":{},"rssi":-85},
  56. {"id":"E3:A6:23:C1:DF:9E","advertising":{},"rssi":-84},
  57. {"id":"F2:62:23:85:2A:13","advertising":{},"rssi":-70},
  58. {"id":"EF:66:D9:58:08:14","advertising":{},"rssi":-81},
  59. {"name":"BPUCK ID 00002A","id":"DD:B9:75:55:D5:2A","advertising":{},"rssi":-79},
  60. {"name":"BPUCK ID 00001D","id":"DF:35:EE:8B:6F:79","advertising":{},"rssi":-73},
  61. {"id":"D7:C0:C1:10:0B:25","advertising":{},"rssi":-81},
  62. {"id":"D9:C2:C3:12:0D:27","advertising":{},"rssi":-88},
  63. {"name":"BPUCK ID 000018","id":"FB:4A:F8:90:71:BD","advertising":{},"rssi":-73},
  64. {"name":"BPUCK ID 000013","id":"C4:75:F6:49:97:82","advertising":{},"rssi":-71},
  65. {"name":"BPUCK ID 000010","id":"E6:31:30:F3:F0:1B","advertising":{},"rssi":-72}
  66.  
  67. ]
  68. },
  69. { "startwgs84longitude":"00.000123",
  70. "startwgs84latitude":"undefined",
  71. "startgpsaccuracy":"undefined",
  72. "starttime":"52-07-2018 09:20:08",
  73. "stopwgs84longitude":"undefined",
  74. "stopwgs84latitude":"54.64323",
  75. "stopgpsaccuracy":"undefined",
  76. "stoptime":"06-07-2018 09:20:29",
  77. "phonebatterylevel":98,
  78.  
  79. "BLEScanObjectList":[
  80. {"name":"BPUCK ID 000020","id":"C3:5E:45:15:70:C2","advertising":{},"rssi":-100}
  81.  
  82. ]
  83. }
  84. ]
  85. }
  86. ]
  87. }', '$.BLETest[*]'
  88. columns (
  89. name varchar2(50 byte) path '$.name',
  90. description varchar2(500 byte) path '$.description',
  91. nbr_scan number(10,0) path '$.nbrscan',
  92. start_time varchar2 path '$.starttime',
  93. scan_periodicity number(10,0) path '$.scanperiodicity',
  94. scan_duration number(10,5) path '$.scanduration',
  95. phone_identifier varchar2(200 byte) path '$.phoneidentifier',
  96. phone_brand varchar2(50 byte) path '$.phonebrand',
  97. phone_model varchar2(50 byte) path '$.phonemodel',
  98. requested_gps_accuracy number(10,0) path '$.requestedgpsaccuracy',
  99. nested path '$.BLEScanList[*]'
  100. columns (
  101. start_wgs84_longitude number(10,5) path '$.startwgs84longitude',
  102. start_wgs84_latitude number(10,5) path '$.startwgs84latitude',
  103. start_gps_accuracy number(10,0) path '$.startgpsaccuracy',
  104. scan_start_time varchar2 path '$.starttime',
  105. stop_wgs84_longitude number(10,5) path '$.stopwgs84longitude',
  106. stop_wgs84_latitude number(10,5) path '$.stopwgs84latitude',
  107. stop_gps_accuracy number(10,0) path '$.stopgpsaccuracy',
  108. stop_time varchar2 path '$.stoptime',
  109. phone_battery_level number(10,0) path '$.phonebatterylevel',
  110. nested path '$.BLEScanObjectList[*]'
  111. columns (
  112. mac varchar2(20 byte) path '$.id',
  113. device_name varchar2(200 byte) path '$.name',
  114. rssi number(15,5) path '$.rssi'
  115. )
  116. )
  117. )
  118. ) j;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement