English 中文(简体)
PL/SQL中的文件上传程序
原标题:File upload procedure in PL/SQL

我正在处理一个 PL/SQL Oracle 网络应用程序, 我需要做一个处理文件上传表格的程序。 文件上传表格字段名称为 < code> new_ photo 。 这是我拥有的代码, 但我提交时总是有错误。 我无法在网上或在甲骨文文档中找到此任务的任何示例 。

错误 :

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;

代码:

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;
/

窗体:

<form action="insert_new_photo" method="post" enctype="multipart/form-data">
<input type="text" name="new_photo"><br>
<input type="submit" value="ok">
</form>
最佳回答

您是否使用mod_ plsql? 如果是这样的话, 我认为您不能直接将文件寄送到 PL/ SQL roc: 您必须定义一个具体表格并修改相关的 DAD 参数( http://docs. orref="http://docs. oracle.com/ cd/ E14571_01/portal.1111/ e12041/consec.htm#i1005866" rel=“ nofol” >http://docs.oracle.com/cd/E14571_01/portal.1111/e12041/concept.htmi1005866 < /a>)。

呵呵。 呵呵。

亚历山德罗

问题回答

纠正我,如果我错了,但你的问题 似乎是,你有很多 争论在你的呼吁 程序

insert_new_photo(:B1,:B2,:B3,:B4,:B5,:B6,:B7,:B8);

你在这里有8个论据,程序本身只有一个

insert_new_photo (new_photo VARCHAR2 DEFAULT NULL)




相关问题
Export tables from SQL Server to be imported to Oracle 10g

I m trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I m not using any constraints/...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

How to make a one to one left outer join?

I was wondering, is there a way to make a kind of one to one left outer join: I need a join that matches say table A with table B, for each record on table A it must search for its pair on table B, ...

Insert if not exists Oracle

I need to be able to run an Oracle query which goes to insert a number of rows, but it also checks to see if a primary key exists and if it does, then it skips that insert. Something like: INSERT ALL ...

How can I store NULLs in NOT NULL field?

I just came across NULL values in NOT-NULL fields in our test database. How could they get there? I know that NOT-NULL constraints can be altered with NOVALIDATE clause, but that would change table s ...

Type reference scope

I m studying databases and am currently working on a object-relational DB project and I ve encountered a small problem with the number of possible constraints in an object table. I m using "Database ...

OracleParameter and DBNull.Value

we have a table in an Oracle Database which contains a column with the type Char(3 Byte). Now we use a parameterized sql to select some rows with a DBNull.Value and it doesn t work: OracleCommand ...

热门标签