I created a stored function in oracle that excepts a clob. When I go to test it I get the error that the value passed to the function is the wrong datatype. Here it is:

CREATE OR REPLACE FUNCTION LOADMASTER(
P_MSG IN CLOB)
RETURN NUMBER IS
x varchar2(25);
BEGIN
x := DBMS_LOB.SUBSTR(P_MSG,2,1);
insert into test
values(x);
commit;
return 0;
end;

here is my test:

1 declare
2 x number;
3 begin
4 x := loadmaster('Hello');
5 dbms_output.put_line(x);
6* end;
SQL> /
declare
*
ERROR at line 1:
ORA-06550: line 4, column 7:
PLS-00306: wrong number or types of arguments in call to 'LOADMASTER'
ORA-06550: line 4, column 2:
PL/SQL: Statement ignored

In the real use I will be passing it a 16135 byte string. But the above test should still work. Any ideas?