13.5.1.2 Modifying REST Source Rows in Code

Use OPEN_REST_SOURCE_DML_CONTEXT in the APEX_EXEC package to modify a row from a REST Data Source.

To define the data source columns whose values you want to work with, use a variable of type APEX_EXEC.T_COLUMNS and call ADD_COLUMN to add one or more column names to it. Make sure to pass the p_data_type parameter of each column, too, as well as passing true for p_is_primary_key on at least one of the columns. Then pass this column list as the p_columns parameter value in your call to open the DML context.

To supply parameter values, use a variable of type APEX_EXEC.T_PARAMETERS, call ADD_PARAMETER to add one or more parameters to it, then pass the parameters variable as the value of p_parameters.

Once you create a "context" to work with rows, call the ADD_DML_ROW procedure to add a new current row to the context, passing a constant of type APEX_EXEC.T_DML_OPERATION as the value of the p_operation parameter. To set the column values on the current row, call SET_VALUE. To process the row you added to the context, call EXECUTE_DML. When done, or when an exception occurs, call CLOSE to clean up context resources.

For more information, see OPEN_REST_SOURCE_DML_CONTEXT Function in Oracle APEX API Reference.