Skip Navigation
Expand
Oracle B2C REST API returns 500 response code for custom object PATCH method
Answer ID 11722   |   Last Review Date 10/12/2020

Why am I getting a 500 Response code from the REST API with an error response detail "Cannot save/update: <custom object>(ID=<id>): DB API Error"?

Environment:

Oracle B2C Service Oracle B2C Service REST API

Resolution:

The REST API returns a response code of 500 including OSC-CREST-00008 and the detail "Cannot save/update: <custom object>(ID=<id>): DB API Error".  This is due to the custom object definition design, specifically the number and type of fields. More details can be found in the error log, there can only be 8126 bytes added per PATCH request, with 768 used in the table itself.  

 DB API Error
     SQL Fcn: execute() [SQLStatement.cpp: 851] 
   Called By: iapiu_pair_update() [iapi_subtbl.c: 661]
     Program: crest
    API Fcn.: _sql_execute() returned 1118
   SQL Error: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
       Error: Error running query
       Errno: 0
   SQL Stmt.: UPDATE <Custom Package>$<Custom Object>

There are a number of ways to handle this, the most straightforward is to redesign this table so that fields that do not need to be text are redefined if possible to another data type. Additionally, the table could be split up into multiple tables for any repeating columns.  Those repeating columns should be put into an association table created to store the N instances of those columns. This would significantly reduce the size of both the main table and the associated table.