我正在开发一个 PL/SQL Oracle Web 应用程序,我需要创建一个处理文件上传表单的过程。文件上传表单字段名称为new_photo
. 这是我的代码,但我提交时总是出错。我在网上或 oracle 文档中找不到此任务的任何示例。
错误:
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>