Hi,
Oracle DB 12.2.0.1
Oracle APEX 18.1
I want to upload BLOB file through REST Data Service enabled on database. On one of my page I have the process with this PL/SQL code, which run when user hit the button:
-- in this example I try to upload very small PDF file(cca 14kB) throught REST Data Service to DB
DECLARE
l_parameters apex_exec.t_parameters;
l_blob BLOB;
l_clob CLOB;
l_varchar2 VARCHAR2(1000);
BEGIN
-- put the BLOB content into BLOB variable
SELECT image
INTO l\_blob
FROM gallery
WHERE id = 4;
-- check the length of BLOB and put the
APEX_DEBUG.message('length 1 = ' || DBMS_LOB.getlength(l_blob));
-- convert the BLOB content into BASE64
l_clob := APEX_WEB_SERVICE.blob2clobbase64(l_blob);
APEX_DEBUG.message('length 2 = ' || DBMS_LOB.getlength(l_clob));
APEX_DEBUG.message('l_clob = ' || l_clob);
APEX_EXEC.add_parameter( p_parameters => l_parameters, p_name => 'DATA', p_value => l_clob);
APEX_EXEC.add_parameter( p_parameters => l_parameters, p_name => 'ID', p_value => '36' );
APEX_EXEC.add_parameter( p_parameters => l_parameters, p_name => 'FILENAME', p_value => 'hello.zip' );
APEX_EXEC.add_parameter( p_parameters => l_parameters, p_name => 'MIME_TYPE', p_value => 'application/pdf' );
-- invoke Web Source Module for and select data
apex_exec.execute_web_source(
p\_module\_static\_id => 'APEX\_TEST',
p\_operation => 'POST',
p\_parameters => l\_parameters );
APEX_DEBUG.message('pocet: ' || l_parameters.COUNT);
APEX_DEBUG.message('MESSAGE: ' || apex_exec.get_parameter_varchar2(l_parameters, 'MESSAGE'));
APEX_DEBUG.message('RESULT: ' || apex_exec.get_parameter_varchar2(l_parameters, 'RESULT'));
-- apex_exec.close;
END;
I run the APEX in DEBUG mode and after hit the button I open the debugged session

On image you can see the whole output of CLOB (after BASE64 convert), but I don't know why this PL/SQL part of code
APEX_EXEC.add_parameter( p_parameters => l_parameters, p_name => 'DATA', p_value => l_clob);
put "empty string" into DATA parameter? Any idea?
Also on the endpoint of REST data service I have this code in POST handler
DECLARE
l_blob_file BLOB;
BEGIN
-- only easy insert of DATA parametr to table
INSERT INTO parameters (id, words, age)
VALUES(:id, :data, 19);
:r_result := 'success';
EXCEPTION
WHEN OTHERS THEN
:r\_result := 'file upload failure';
:r\_message := sqlerrm;
END;
After run the REST call there is new row in parameters table, but with NULL value in "words" column so I suppose "no data" was send thought APEX_EXEC.execute_web_source procedure.
Where is a problem? Bug in APEX_EXEC package?
Thanks.
David