Oracle Magazine, May/June 2018
Database Developer PL SQL 11 Parse the document text into a hierarchical in memory representation At this point if json_ document_ in is not a valid array the following error will be raised ORACLE MAGAZINE MAY JUNE 2018 75 ORA 40587 invalid JSON type You can verify this with the following block DECLARE l_ doc CLOB name Spider BEGIN json_ array_ traversal l_ doc q BEGIN NULL END END 13 Display the document passed in taking advantage of the stringify method 15 Iterate through each element in the array The get_ size method returns the number of elements in the array Remember that JSON array indexes start with zero 0 So this works FOR indx IN 0 l_ array get_ size 1 But a formulation consistent with iteration through a PL SQL nested table such as FOR indx IN 1 l_ array get_ size is likely to result in this error ORA 30625 method dispatch on NULL SELF argument is disallowed 19 Because an element in an array can be a scalar object or another array provide a WHEN clause for each possibility Well not each and every possibility There are more types of scalars than string but I leave the expansion of the CASE statement to cover all scalar types
You must have JavaScript enabled to view digital editions.