Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> PRO*C/C++ EMBEDDED PL/SQL BLOB QUESTION

PRO*C/C++ EMBEDDED PL/SQL BLOB QUESTION

From: Jerry Drexler <drexler_jerry_at_htc.honeywell.com>
Date: Wed, 07 Oct 1998 22:25:43 GMT
Message-ID: <6vgpmk$aut$1@chico.htc.honeywell.com>


I am trying to use the function "DBMS_LOB.WRITE" in a pro c/c++ program to store a BLOB and received an error while precompiling. Someone at Oracle suggested that OCI is the only way to do this using OciLobWrite(). Is this true?

Here is an example of my code :      

        EXEC SQL EXECUTE
                DECLARE
                locator_var BLOB;
                amount_var   INTEGER;
                offset_var      INTEGER;
          BEGIN
                amount_var :=1024;
                offset_var := 1;
                INSERT INTO BUNK VALUES(

:l_ObjectID,
:l_BunkName,
:l_BunkShort,
:l_BunkDouble,
EMPTY_BLOB()); SELECT C_BUNKARRAY INTO locator_var FROM BUNK WHERE C_OBJECT_ID = :l_ObjectID FOR UPDATE; DBMS_LOB.WRITE(locator_var,amount_var,offset_var,:mybuffer); COMMIT; END; END-EXEC;

using the table

SQLWKS> describe bunk

Column Name                    Null?    Type
------------------------------ -------- ----
C_OBJECT_ID                             NUMBER
C_BUNKNAME                              VARCHAR2(30)
C_BUNKSHORT                             NUMBER
C_BUNKDOUBLE                            NUMBER
C_BUNKARRAY                             BLOB(4000)


Thanks!

Jerry Drexler Received on Wed Oct 07 1998 - 17:25:43 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US