The code formatter appears to be silently failing when confronted with an "Open for select from json_table(...);" in a block. It has no trouble with the select on its own or when placed in a cursor for loop. Additionally, it has no problem with other open cursors for expressions. Below is an example, before and after.
/* Formatted on 06/20/2018 16:00:28 (QP5 v5.326) */
SELECT refid,
advisoryid,
status_code,
err_id,
err_message
FROM JOE_TABLE (
p_resp,
'$.createResponse.creates.create[*]'
COLUMNS (refid VARCHAR2 (300 CHAR) PATH '$."@id"',
advisoryid VARCHAR2 (300 CHAR) PATH '$."@advisoryId"', -- is this column necessary?
status_code VARCHAR2 (3 CHAR) PATH '$."@statusCode"',
err_id VARCHAR2 (4000) PATH '$.error."@id"',
err_message VARCHAR2 (4000) PATH '$.error.message'));
DECLARE
FUNCTION f_query_post_resp (p_resp CLOB)
RETURN results_ref_type
IS
response_ref results_ref_type;
BEGIN
IF REGEXP_COUNT (p_resp,
'"create":\[',
1,
'i') > 0
THEN
IF DEBUG_FLG
THEN
p_debug ('Opened joe_table cursor with array step');
END IF;
OPEN results_ref FOR
SELECT refid,
advisoryid,
status_code,
err_id,
/* Formatted on 06/20/2018 16:02:43 (QP5 v5.326) */
SELECT refid,
advisoryid,
status_code,
err_id,
err_message
FROM JOE_TABLE (
p_resp,
'$.createResponse.creates.create[*]'
COLUMNS (refid VARCHAR2 (300 CHAR) PATH '$."@id"',
advisoryid VARCHAR2 (300 CHAR) PATH '$."@advisoryId"', -- is this column necessary?
status_code VARCHAR2 (3 CHAR) PATH '$."@statusCode"',
err_id VARCHAR2 (4000) PATH '$.error."@id"',
err_message VARCHAR2 (4000) PATH '$.error.message'));
DECLARE
FUNCTION f_query_post_resp (p_resp CLOB)
RETURN results_ref_type
IS
response_ref results_ref_type;
BEGIN
IF REGEXP_COUNT (p_resp,
'"create":\[',
1,
'i') > 0
THEN
IF DEBUG_FLG
THEN
p_debug ('Opened joe_table cursor with array step');
END IF;
OPEN results_ref FOR
SELECT refid,
advisoryid,
status_code,
err_id,
err_message