DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: CLOB datatype

  1. #1
    Join Date
    Jan 2001
    Posts
    515
    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?


  2. #2
    Join Date
    Mar 2001
    Posts
    71
    Try this:

    1 declare
    2 amt binary_integer;
    3 offset integer;
    4 x number;
    5 y clob;
    6 begin
    7 amt := 5;
    8 offset := 1;
    9 dbms_lob.createtemporary(y, true);
    10 dbms_lob.write(y,amt,offset,'Hello');
    11 x := loadmaster(y);
    12 dbms_output.put_line(x);

    HTH

    np70

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width