Oracle SQL 程序。这里的错误是什么?

Oracle SQL Procedure. What is the error here?

我在 Oracle APEX 中写了一个 PL/SQL 过程,当我编译它时,我得到一个错误。 我不明白错误的原因是什么。在我看来,sintaxis 是正确的。

这是一个屏幕截图: https://i.imgur.com/UhfIMvh.png

这是代码:

create or replace PROCEDURE imageBLOBtoHTML(  v_MimeType IN VARCHAR2 (255) := null,
                                              v_Size IN NUMBER := null,
                                              v_file_name IN VARCHAR2 (2000) := null,
                                              imageBLOB IN NOCOPY BLOB  := null )
AS
BEGIN

       --Generates HTML
       OWA_UTIL.mime_header (NVL (v_MimeType , 'application/octet'), FALSE);
       htp.p('Content-length: ' || v_Size );
       htp.p('Content-Disposition:  filename="' || SUBSTR(v_file_name , INSTR(v_file_name , '/') + 1) || '"');
       owa_util.http_header_close;

       --Stops generation of HTML
       wpg_docload.download_file(imageBLOB);
END imageBLOBtoHTML;

这是错误:

Compilation failed,line 1 (13:39:25)
PLS-00103: Encountered the symbol "(" when expecting one of the following: := . ) , @ % default character

错误在行:

  imageBLOB IN NOCOPY BLOB  :=  null 

您需要更改它:

imageBLOB     IN OUT NOCOPY BLOB := ''

我会这样说:

CREATE OR REPLACE PROCEDURE imageBLOBtoHTML (
   v_MimeType    IN            VARCHAR2  := '',
   v_Size        IN            NUMBER := '',
   v_file_name   IN            VARCHAR2  := '',
   imageBLOB     IN OUT NOCOPY BLOB := '')

把我的回答和XING的回答结合起来应该是这个:

create or replace PROCEDURE imageBLOBtoHTML( v_MimeType IN VARCHAR2 := null,
                                             v_Size IN NUMBER,
                                             v_file_name IN VARCHAR2,
                                             imageBLOB IN OUT NOCOPY BLOB)

允许其他参数为 NULL(即,将 NULL 设置为默认值)没有意义。