Search notes:

Oracle: JSON_TABLE - ERROR clause

No error clause, the value three is silently represented as null:
select * from 
   json_table ('[
     [1, "one"  , "B"],
     [2, "two"  , "C"],
     [3, "three", "D"],
     [4, "four" , "E"],
    ]',
   '$[*]'
    columns
       id    number  ( 1) path '$[0]' ,
       num   varchar2( 4) path '$[1]' ,  -- NOTE the varchar2(4) which is too small for "three"
       meta  varchar2( 3) path '$[2]'
    );
   
--         ID NUM  MET
-- ---------- ---- ---
--          1 one  B 
--          2 two  C 
--          3      D 
--          4 four E     
Applying the error on error clause «globally» for the entire json_table expression:
select * from
   json_table ('[
     [1, "one"  , "B"],
     [2, "two"  , "C"],
     [3, "three", "D"],
     [4, "four" , "E"],
    ]',
   '$[*]'
    ERROR ON ERROR
    columns
       id    number  ( 1) path '$[0]' ,
       num   varchar2( 4) path '$[1]' ,
       meta  varchar2( 3) path '$[2]'
    );
--
-- ORA-40478: output value too large (maximum: 4)
--
Applying the error on error clause on selected columns:
select * from
   json_table ('[
     [1, "one"  , "B"],
     [2, "two"  , "C"],
     [3, "three", "D"],
     [4, "four" , "E"],
    ]',
   '$[*]'
    columns
       id    number  ( 1) path '$[0]',
       num   varchar2( 4) path '$[1]' ERROR ON ERROR,
       meta  varchar2( 3) path '$[2]'
    );
--
-- ORA-40478: output value too large (maximum: 4)
--

See also

json_table

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758193699, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL/functions/json/error-clause(95): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78