ORDS FILE UPLOAD NON-APEX MOD_PLSQL APPLICATION

875 Views Asked by At

We are in the process of upgrading a mod_plsql application to ORDS 3. I found some information under: File uploads in a non-Apex PL/SQL application migrated to ORDS. In this, Kris Rice states, "Important question. Do you have apex in this db at all? my answer is different based on that." Then an Answer is provided. I am unable to tell if this Answer was for having apex in the DB or not having Apex in the DB. We do not have Apex in the DB. I've tried the steps in the Answer but we get: PLS-00306:wrong number or types of arguments in call to 'UPLOAD_PROC'.

Has anyone been able to get file upload to work without much code changes when moving a mod_plsql application to ORDS3?

2

There are 2 best solutions below

9
On

This is the current logic.

This SQL is executed in the schema.

select  version_no from apex_release

If that is 4+ Then this is run

begin ? := apex_util.set_blob(.... ); end;";

If is less than 4, Then this is run where %s is the value of apex.docTable in the defaults.xml

BEGIN INSERT INTO %s (name, mime_type, content_type, dad_charset, last_updated, blob_content)
1
On

In addition to the steps indicated by Kris Rice, we had CONTENT_TYPE VARCHAR2(128 BYTE) NOT NULL in our upload table. We changed this to allow nulls and our file upload started working.