Hi!
   
  I have the following problem: I create a procedure where I use
dbms_lob.writeappend function:

CREATE OR REPLACE PROCEDURE kelu.append_to_blob(name_of_index VARCHAR2, amt 
BINARY_INTEGER, buffer RAW) AS 
BEGIN 
DECLARE 
lob_loc    BLOB; 
begin 
        SELECT app_blob INTO lob_loc FROM for_append WHERE app_name=name_of_index FOR 
UPDATE; 
        dbms_lob.writeappend (lob_loc, amt, buffer); 
end; 
END; 
/

I use that procedure in a java application:


                Statement stmt = con.createStatement(); 
                CallableStatement cstmt = con.prepareCall("{call 
append_to_blob(?,?,?)}"); 
                 
                String str = "this is the first string written in this database"; 
                 
                cstmt.setString(1,"vvv"); 
                cstmt.setInt(2,str.length()); 
                cstmt.setBytes(3,str.getBytes()); 
                 
                System.out.println(cstmt.executeUpdate()); 

and I get the following exception:


java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: invalid LOB locator 
specified: ORA-22275 
ORA-06512: at "SYS.DBMS_LOB", line 715 
ORA-06512: at "KELU.APPEND_TO_BLOB", line 7 
ORA-06512: at line 1 
  
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)  
        at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)  
        at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)  
        at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)  
        at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)  
        at 
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)  
        at 
oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)  
        at 
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)  
        at 
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
  
        at Test_append.main(Test_append.java:28)  


What am I missing where?
Best regards,
Vulpe Cristian
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to