2012-03-08 71 views
0

这是我的存储过程:secondArgument列获取从存储过程BLOB在甲骨文

CREATE OR REPLACE 
PROCEDURE prodecureName 
    (
    firstArgument IN NUMBER, 
    secondArgument OUT BLOB) 
AS 
BEGIN 
    SELECT secondArgument 
    INTO prodecureName.secondArgument 
    FROM tableName 
    WHERE firstArgument = prodecureName.firstArgument ; 
END; 

数据类型是有效的(都是BLOB)。 在执行此过程中我得到这个错误:

Wrong number or types of arguments in call to prodecureName

如何我可以从存储过程BLOB?调用这个程序

+0

你能后调用代码,太?该错误很可能是有 – 2012-03-08 11:44:39

+0

代码无所谓。我尝试从SQL Developer调用此过程。我得到这个相同的错误。 – ogrod87 2012-03-08 11:51:09

+2

的确很重要,因为它似乎是错误的,你把它的方式...... – 2012-03-08 11:55:06

回答

1

方式一:

declare 
    l_blob blob; 
begin 
    procedurename(1,l_blob); 
end; 

该错误消息表明您正在使用的错误类型的参数或错误数量的参数调用此。第一个参数必须由类型号,类型为blob的第二个参数。

0

试着这么做(使用CLOB而非BLOB,但是同样的方法):

drop table tst_clob_tab; 
create table tst_clob_tab 
(
    id number, 
    my_clob clob 
); 

-- Oracle will implicitly convert to clob (9i greater) 
insert into tst_clob_tab(id,my_clob) values (1,'This is some large value...'); 
commit; 

-- Create procedure 
create or replace procedure tst_clob(p_1 in number, p_2 out clob) as 
begin 
    select my_clob 
    into p_2 
    from tst_clob_tab 
    where id = p_1; 
end; 

-- Call procedure 
declare 
    l_clob clob; 
begin 
    tst_clob(1,l_clob); 
    dbms_output.put_line('Clob: ' || l_clob); 
end;