log_apex_items raises ORA-06502 when Apex item is > 4000 chars
If an Apex item is longer than 4000 characters, it's stored in wwv_flow_data.item_value_clob, not item_value_vc2. Calling log_apex_items when such an item exists raises ORA-06502, PL/SQL: numeric or value error: character string buffer too small.
I think this is because the V function can return a PL/SQL VARCHAR2 of up to 32767 characters, but the SQL engine can't take any more than 4000. The snapshot_apex_items does a SQL insert.
I'm using Apex 4.2, still. Not sure if the behavior has changed in 5.x.
This happens in 11g. In 12c with max_string_size set to EXTENDED, I couldn't replicate the issue. I don't have a 12c instance with max_string_size of STANDARD to test with.