title: File upload procedure in PL/SQL
body: <p>I am working on a PL/SQL Oracle web application and I need to make a procedure that processes a file upload form. The file upload form field name is <code>new_photo</code>. This is the code I have but I always get an error when I submit. I can't find any examples for this task online or in the oracle documentation.</p>
  
  <p>The error: </p>
  
  <pre><code>Error 6550 calling procedure:
  
  ORA-06550: line 2, column 3:
  PLS-00306: wrong number or types of arguments in call to 'INSERT_NEW_PHOTO'
  ORA-06550: line 2, column 3:
  PL/SQL: Statement ignored
  
  The last SQL statement executed was:
  
  begin
    insert_new_photo(:B1,:B2,:B3,:B4,:B5,:B6,:B7,:B8);
  end;
  </code></pre>
  
  <p>The code:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE insert_new_photo (new_photo VARCHAR2 DEFAULT NULL) IS
      BEGIN
  
         -- if the user didn't chose a file to upload
         IF new_photo IS NULL OR LENGTH( new_photo ) = 0
         THEN
         print_page_header;
         print_error( 'Please supply a file name.' );
         print_upload_form;
         --print_page_trailer( TRUE );
         return;
     END IF;
  
  END insert_new_photo;
  /
  </code></pre>
  
  <p>the form :</p>
  
  <pre><code>&lt;form action="insert_new_photo" method="post" enctype="multipart/form-data"&gt;
  &lt;input type="text" name="new_photo"&gt;&lt;br&gt;
  &lt;input type="submit" value="ok"&gt;
  &lt;/form&gt;
  </code></pre>