Son varios Scripts de Using JSON_OBJECT_T to Manipulate JSON Data in PL/SQL.
JSON_OBJECT_T was added to Oracle Database 12c Release 2, as part of a suite of object types/APIs to allow native manipulation of JSON data in PL/SQL. JSON_OBJECT_T is for use with JSON objects. This code was provided by Darryl Hurley, as part of the ODTUG CodeTalk series.
Son 13 ejemplos de script para usar JSON_OBJECT_T en orden de dificultad.
Ejemplo Script 2:
DECLARE
l_object json_object_t;
l_key_list json_key_list;
BEGIN
-- JSON_OBJECT can figure out what keys it has...
l_object := json_object_t.parse (
'{"Name":"Elvis",
"Address":"Elsewhere",
"Numbers":[1,2,3,4,5],
"Stuff":[{"A":"B"},{"B":"C"}]}');
l_key_list := l_object.get_keys;
FOR counter IN 1 .. l_key_list.COUNT
LOOP
DBMS_OUTPUT.put_line (
l_key_list (counter)
|| ' = '
|| l_object.get_string (l_key_list (counter)));
END LOOP;
END;
SALIDA:
Name = Elvis
Address = Elsewhere
Numbers =
Stuff =
Ver lo otros ejemplos en la web original
Fuentes.
Artículo: "Using JSON_OBJECT_T to Manipulate JSON Data in PL/SQL" Publicado en https://livesql.oracle.com/ por Steven Feuerstein el 20 de Febrero, 2018. Consultado el 22/08/2024.
URL: https://livesql.oracle.com/apex/livesql/file/content_GAYINRPNAY5EYANPGZ704WX93.html
No hay comentarios:
Publicar un comentario