Updating Blob

I am trying to write a java program to update blob in db. I am reading binary from filer and trying to update the blob. So table that has payload I am saying
update A
payload = ?
where A.id = 1
But I am getting ORA-00900: invalid SQL statement error.
In java program I am setting BinaryStream. something like
String SQL = "udpate fp set payload = ? where id = " + s + " and length(raw_payload) > 0 ";
System.out.println(SQL);
// Prepare a Statement:
PreparedStatement stat= conn.prepareStatement(SQL);
// Execute
try {
     File f = new File("blob_upd.dat");
BufferedInputStream b = new BufferedInputStream(new FileInputStream(f));
stat.setBinaryStream(1,b,(int)f.length());
System.out.println("Number of rows updated " + stat.executeQuery());
b.close();

I have recently updated Morgan's Library at www.psoug.org with a demo of Oracle's new DICOM data type that involves updating a BLOB.
Compare my working demo with what you are doing.

Similar Messages

  • Error when updating blob column

    Hello,
    im using the SQL-Developer and i have problems with updating blob columns.
    I'm getting the following error:
    UPDATE "MED400_INSTALL"."AMEDN_INSURANCE_TEMPL" SET WHERE ROWID = 'AAM6j5ABGAAAADpAAJ' AND ORA_ROWSCN = '26019698898'
    One error saving changes to table "MED400_INSTALL"."AMEDN_INSURANCE_TEMPL":
    Row 15: ORA-01410: Ungültige ROWID
    I'm updating different tables and different rows.
    This error is not shown in all cases. I can update some rows but not all off them.
    Is this a bug?
    TIA

    I made some further investigations and have some more results.
    - the problem does not occur all the time
    - the problem seems to occur in the following situation
    - User A: updates the blob-field using the sql developer menu and commits (-> success)
    - User B: updates the blob-field using the sql developer menu and tries to commit (-> error)
    - the error stays until User B does a rollback, after the rollback user B can update the blob-field! and user A gets the error.
    Here are some extracts of sql developer log. It shows that the same row can be updated in somes cases, in others cases you get an error. After a rollback the field can be updated successfully The rowid ist the same. ora_rowscn is different:
    UPDATE "AZUBI2"."AMEDN_INSURANCE_TEMPL" SET WHERE ROWID = 'AAc6TTACEAAAAHQAAC' AND ORA_ROWSCN = '26087686991'
    One error saving changes to table "AZUBI2"."AMEDN_INSURANCE_TEMPL":
    Row 1: ORA-01410: Ungültige ROWID
    Rollback Successful
    UPDATE "AZUBI2"."AMEDN_INSURANCE_TEMPL" SET WHERE ROWID = 'AAc6TTACEAAAAHQAAC' AND ORA_ROWSCN = '26087687075'
    Commit Successful
    I could offer a dump where you can possibly reproduce this issue. Where can I send or upload it.
    Best regards,
    zebadmin

  • Updating blob files

    can somebody help me, can mysql update blob data fields? or is there another way to change data i blob columns/...

    Hi,
    I've done this before in Oracle so not sure about mysql.
    In Oracle, we have to insert a row into the database with an empty BLOB using the empty_blob() function within Oracle.
    Then its a matter of calling a select on the row for UPDATE and streaming the BLOB into the database.
    eg.
    String sql = "INSERT into TABLE values (a,empty_blob());
    ... execute sql
    then select on the table like this
    String sql = "Select BLOB from TABLE where id = a for UPDATE; (Where BLOB is your Blob column name)
    execute sql and the BLOB value returned can be used
    BLOB blob = (BLOB)rs.getBlob(1);
    I had to cast from the java.sql.Blob type to the oracle.sql.BLOB type then get an output stream and stream your data in. I used a byte[] to do this.
    I'm not sure how you would go about this in mysql but maybe I've pointed you in the right direction.
    hope this helps

  • Problem Updating BLOB Data in DB

    Hi, There,
    I have a problem when updating BLOB data in database table. I am
    using Oracle 8.1.6, JDK1.3.0., oracle thin driver.
    I have a Handle object handle (javax.ejb.Handle), and I need to
    save this object in DB. The table has 2 columns: column 1
    is "PK" Varchar2(30) Primary Key, column 2 is "HANDLE" BLOB.
    According to the documentation I found from Oracle, I first
    initialize the blob column, and then get the BLOB locator.
    However when I try to update the BLOB data by invoking
    executeUpdate() method on OraclePreparedStatement ops, I always
    get the returned int rowCount=0, which indicates that no rows
    have been updated. (This is verified by trying to retrieve the
    BLOB column value which results in SQLException: Exhausted
    Resultset.)
    Any suggestions what was wrong with the code? Thank you a lot in
    advance!
    Tom
    Part of the code is listed below:
    // If jSessionID is not found, create it
    HttpSession session = request.getSession(true);
    String jSessionID = session.getId();
    //get the Hanlde object for MemberInfo bean
    javax.ejb.Handle handle = memberValidate.validateMember(
    memberID, "" );
    oracle.sql.BLOB oracleBlob = null;
    /* Get DB connection */
    try
    Connection conn = getDBConnection(); // with oracle thin driver
    conn.setAutoCommit(false);
    catch (NamingException ne)
    System.out.println( "Failed to getDBConnection due to Naming
    Exception" + ne.toString() );
    return;
    catch (SQLException sqle)
    System.out.println( "Failed to getDBConnection due to SQL
    Exception"+ sqle.toString() );
    return;
    try
    pstmt=conn.prepareStatement("CREATE TABLE TOM1 (PK VARCHAR(30)
    PRIMARY KEY, HANDLE BLOB NOT NULL)");
    pstmt.execute();
    pstmt=conn.prepareStatement("INSERT INTO TOM1 VALUES('ROW1',
    EMPTY_BLOB())");
    pstmt.executeUpdate();
    pstmt=conn.prepareStatement("SELECT HANDLE FROM TOM1 WHERE
    PK=? FOR UPDATE");
    pstmt.setString(1, "ROW1");
    ResultSet rset = pstmt.executeQuery();
    if ( rset.next() )
    // Get the LOB locator from the ResultSet
    oracleBlob = ((OracleResultSet)rset).getBLOB("HANDLE");
    OraclePreparedStatement ops = null;
    ops = ( OraclePreparedStatement )
    (conn.prepareStatement("UPDATE TOM1 SET HANDLE = ?
    WHERE PK = ?"));
    ops.setString( 2, jSessionID );
    // using OutputStream to write object data
    OutputStream oStream = oracleBlob.getBinaryOutputStream();
    ObjectOutputStream outStream = new ObjectOutputStream
    (oStream);
    outStream.writeObject(handle); // handle is the Object to be
    saved
    outStream.close();
    conn.commit();
    conn.setAutoCommit(true);
    ops.setBLOB( 1, oracleBlob );
    int rowCount = ops.executeUpdate();
    System.out.println("\n**** Rows affected: ");
    System.out.println(ops.executeUpdate());
    if (rowCount != 0)
    // Commit the transaction:
    System.out.println("\n**** conn.commit() OK...");
    System.out.println("\n**** Handle saved in DB as Blob-type
    OK...");
    conn.commit();
    conn.close();
    else
    System.out.println("\n**** ops.executeUpdate() == 0, Failed
    to update DB");
    conn.close();
    return;
    catch ( SQLException se )
    se.printStackTrace();
    return;
    catch ( Exception e )
    System.out.println(e.toString());
    return;
    System.out.println("\n**** DB update OK...");
    null

    You cannot update Blob column in Adf testing tool as far i think
    check this blog might help you to store images in ADF http://baigsorcl.blogspot.com/2010/09/store-images-in-blob-in-oracle-adf.html

  • Update Blob type field

    I don't understand why.... I can't seems to update blob field type. Is there a special type of update for blob type? I will get the value from the form, typecast it to string then update the db. All fields can be updated except the blob type field....

    It depends. Eg. Oracle requires to call its own factory classes. You cannot use standard JDBC.
    The same with DB2.

  • Help! Problem Updating Blob Columns

    Good day
    Please i have problems updating Blob columns storing images and doc files. can someone put me through the way out hassle free
    Thank You
    God Bless U all
    Femi

    I keep geting this error
    java.sql.SQLException: ORA-01729: database link name expected
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
    when ever i try to update The Blob colum with a Blob object retrieved by resultset.getBlob from another Blob column of a different table.
    Blob b = rset.getBlob(1);
    String x = (String)jComboBox2.getSelectedItem();     
         ps=c.prepareStatement("UPDATE PROPERTIES SET "+x+" = "+b+" WHERE NAME = ?");
         ps.setString(1, (String)jComboBox1.getSelectedItem());
         System.out.println("success");
         ps.executeUpdate();

  • OCI_INVALID_HANDLE updating BLOB in Typo3/PHP

    Hi all,
    We're busy with implementing Typo3 (OpenSource CMS in PhP) on Oracle (XE universal).
    We're running in a OCI_INVALID_HANDLE problem during page refreshes (CTRL-Refresh).
    The actual error is:
    Warning: OCI-Lob::save() [oci-lob.save]: OCI_INVALID_HANDLE in /var/www/sources/typo3_src-4.2.10/typo3/sysext/adodb/adodb/drivers/adodb-oci8.inc.php on line 696
    The piece of code where it refers to is:
         function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
              //if (strlen($val) < 4000) return $this->Execute("UPDATE $table SET $column=:blob WHERE $where",array('blob'=>$val)) != false;
              switch(strtoupper($blobtype)) {
              default: ADOConnection::outp("<b>UpdateBlob</b>: Unknown blobtype=$blobtype"); return false;
              case 'BLOB': $type = OCI_B_BLOB; break;
              case 'CLOB': $type = OCI_B_CLOB; break;
              if ($this->databaseType == 'oci8po')
                   $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO ?";
              else
                   $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO :blob";
              $desc = OCINewDescriptor($this->connectionID, OCID_LOB);
              $arr['blob'] = array($desc,-1,$type);
              if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=EXACT');
              $commit = $this->autoCommit;
              if ($commit) $this->BeginTrans();
              $rs = $this->_Execute($sql,$arr);
              if ($rez = !empty($rs)) $desc->save($val); ##################### this is line 696
              $desc->free();
              if ($commit) $this->CommitTrans();
              if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=FORCE');
              if ($rez) $rs->Close();
              return $rez;
    I've googled around for some time and also queried this forum, but could not find any suggestions. To me it seems quite ok what is done here. And it is some standard Typo3 code.
    Could you please shine your light upon it and maybe give me some ideas to solve this?
    Thank you very much.
    Regards,
    Martien

    See my answer to your other post, inserting a text file into a clob field

  • UPDATE BLOB type with J2SE (JDBC ORACLE outbound adapter)

    Hi all,
    I'm trying update row into Oracle table with column type BLOB via XI 3.0, but it doesn't work.
    Does anyone send me some sample of correct XML file, with update column type BLOB ?
    Thanks
    My test XML document :
    ?xml version="1.0" encoding="UTF-8"?>
    <root>
    <StatementName1>
    <SAPXI_OUTPUT action="UPDATE">
    <access>
                <DGPODPIS >sdcfo2JTiXE=</DGPODPIS>
    </access>
    <key1>
                <SAPO_ID>1001</SAPO_ID>
    </key1>
    </SAPXI_OUTPUT>
    </StatementName1>
    </root>

    Hi !
    I have make some test's today. I copy the adapter from our productive system P15 SP3 to the developers D15 SP6. Then we take the same message and send this from sap p42 to sap xi d15 sp5 to the adapter d15 (copy from p15 sp3) to the same Oracle database and it's working.
    SAP P42 - Orders - XI D15 SP6 - Orders - Adapter D15 (copy from P15SP3) = it's working Record > ca. 800
    I think we have a problem in the patch sp5.
    We found also some different size in the adapter files.
    This are the jar- files with different size:
    SAPAdapterService.exe
    adapter.properties
    aii_msg_adapter.jar
    aii_msg_runtime.jar
    aii_rfcadapter.jar
    aii_util_grmg.jar
    aii_util_misc.jar
    aii_util_rb.jar
    inqmyxml.jar
    lcrclient.jar
    logging.jar
    I make tomorow, a test with a adapter sp4.
    Regards Thomas Neuhaus

  • Slow in updating blob

    I have a table with a blob column. The table is partitioned. Each partition has about 600,000 rows of data. The blob size is between 6000 bytes to 13000 bytes.
    The lob is defined as CHUNK 8192 and PCTVERSION 15
    Normally only very small percentage of the blob column will be updated and there is no performance issue.
    However, recently, I have a need to update about 90 % of the blob. It appeared that the performance was good at the beginning and it kept going down. For example, it updated 9 rows per second for the first 7000 records., 8 rows per second for the next 8000 records, 7 rows per second for the next 5000 records…… after 140,000 record, it only update 2.5 rows per second and it kept going down.
    Does the PCTVERSION 15 cause any problem on this? Does anybody know how I can improve the perfomance on updating the blob?

    Oracle version is 10.2.0.3.0
    The update statements are as follows:
    int offset=1;
    EXEC SQL ALLOCATE :lob;
         EXEC SQL UPDATE stories SET body = EMPTY_BLOB()
                   WHERE storyid = :storyid RETURNING body INTO :lob;
         EXEC SQL LOB WRITE ONE :lobsz FROM :lvr WITH LENGTH :lobsz
                                  INTO :lob AT :offset;
    *** FYI - the length of the blob has the same size before and after, only the content changes..

  • Update blob column

    dear all
    I am new to oracle database...
    and i create one BLOB column to insert the images..
    i can insert and retrieve the image data...
    but i cant update this column...
    can any one guide me to do this.
    i tried to empty the column and update but still fails..
    update tablename set columnname=empty_blob()
    i tried the above and its clear the data ...but again i cant update this ...
    i am using oracle 10g express edition.
    any suggestion
    thank you

    i tried to empty the column and update but still fails..How does it fail? Please describe the behaviour in more detail, including any error messages and related information.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • How to update BLOB resource ???

    Hi,
    I've created BLOB resource successfully.
    But after my attempt to update it using
    UPDATE resource_view SET res=updatexml(res,'/Resource/Contents/*',blob_res)
    WHERE any_path= '/path';
    I get an error
    ORA-06550: line 17, column 7: PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got BLOB ORA-06550: line 15, column 3: PL/SQL: SQL Statement ignored
    I need a help !!!
    Thanks
    Viacheslav

    Please note that technically updating XDB$RESOURCE directly is not supported.....
    open mdrake-lap 2100
    user XDBTEST XDBTEST
    cd /home/XDBTEST
    ls -l
    put "RedwoodShores.jpg" "RedwoodShores.jpg"
    ls -l
    get "RedwoodShores.jpg" "RedwoodShores.jpg.out"
    quit
    Connected to mdrake-lap.
    220 mdrake-lap FTP Server (Oracle XML DB/Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    331 pass required for XDBTEST
    230 XDBTEST logged in
    250 CWD Command successful
    200 PORT Command successful
    150 ASCII Data Connection
    drw-r--r-- 2 XDBTEST oracle 0 MAR 22 10:13 xsd
    226 ASCII Transfer Complete
    ftp: 59 bytes received in 0.25Seconds 0.24Kbytes/sec.
    200 PORT Command successful
    150 ASCII Data Connection
    226 ASCII Transfer Complete
    ftp: 352071 bytes sent in 0.88Seconds 399.17Kbytes/sec.
    200 PORT Command successful
    150 ASCII Data Connection
    -rw-r--r-- 1 XDBTEST oracle 352071 MAR 22 10:13 RedwoodShores.jpg
    drw-r--r-- 2 XDBTEST oracle 0 MAR 22 10:13 xsd
    226 ASCII Transfer Complete
    ftp: 132 bytes received in 0.00Seconds 132000.00Kbytes/sec.
    200 PORT Command successful
    150 ASCII Data Connection
    226 ASCII Transfer Complete
    ftp: 352071 bytes received in 0.08Seconds 4400.89Kbytes/sec.
    221 QUIT Goodbye.
    open mdrake-lap 2100
    user XDBTEST XDBTEST
    cd /home/XDBTEST
    ls -l
    get "RedwoodShores.jpg" "output1.jpg"
    quit
    Connected to mdrake-lap.
    220 mdrake-lap FTP Server (Oracle XML DB/Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    331 pass required for XDBTEST
    230 XDBTEST logged in
    250 CWD Command successful
    200 PORT Command successful
    150 ASCII Data Connection
    -rw-r--r-- 1 XDBTEST oracle 352071 MAR 22 10:13 RedwoodShores.jpg
    drw-r--r-- 2 XDBTEST oracle 0 MAR 22 10:13 xsd
    226 ASCII Transfer Complete
    ftp: 132 bytes received in 0.00Seconds 132000.00Kbytes/sec.
    200 PORT Command successful
    150 ASCII Data Connection
    226 ASCII Transfer Complete
    ftp: 352071 bytes received in 0.18Seconds 1955.95Kbytes/sec.
    221 QUIT Goodbye.
    SQL*Plus: Release 10.1.0.2.0 - Production on Mon Mar 22 11:14:00 2004
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    SQL> spool testcase.log
    SQL> set trimspool on
    SQL> --
    SQL> set timing on
    SQL> set long 10000
    SQL> set pages 10000
    SQL> set feedback on
    SQL> set lines 132
    SQL> --
    SQL> connect sys/oracle as sysdba
    Connected.
    SQL> --
    SQL> alter session set current_schema = XDB
    2 /
    Session altered.
    Elapsed: 00:00:00.01
    SQL> create or replace package XDB_EXAMPLES
    2 AUTHID DEFINER
    3 as
    4 procedure updateResource(path VARCHAR2,content BLOB);
    5 end;
    6 /
    Package created.
    Elapsed: 00:00:00.12
    SQL> show errors
    No errors.
    SQL> --
    SQL> select * from all_errors where owner = 'XDB'
    2 /
    OWNER NAME TYPE SEQUENCE LINE POSITION
    TEXT
    ATTRIBUTE MESSAGE_NUMBER
    XDB XDB_EXTENSIONS PACKAGE 1 4 42
    PLS-00103: Encountered the symbol "(" when expecting one of the following:
    := . ) , @ % default character
    The symbol ":=" was substituted for "(" to continue.
    ERROR 103
    1 row selected.
    Elapsed: 00:00:00.03
    SQL> create or replace package body XDB_EXAMPLES
    2 as
    3 --
    4 procedure updateResource(path VARCHAR2,content BLOB)
    5 is
    6 RESID RAW(16);
    7 begin
    8 select RESID
    9 into RESID
    10 from RESOURCE_VIEW
    11 where equals_path(res,path) = 1;
    12 -- Not really supported...
    13 update XDB.XDB$RESOURCE R
    14 set R.XMLDATA.XMLLOB = content
    15 where object_id = RESID;
    16 commit;
    17 end;
    18 --
    19 end;
    20 /
    Package body created.
    Elapsed: 00:00:00.01
    SQL> show errors
    No errors.
    SQL> --
    SQL> select * from all_errors where owner = 'XDB'
    2 /
    OWNER NAME TYPE SEQUENCE LINE POSITION
    TEXT
    ATTRIBUTE MESSAGE_NUMBER
    XDB XDB_EXTENSIONS PACKAGE 1 4 42
    PLS-00103: Encountered the symbol "(" when expecting one of the following:
    := . ) , @ % default character
    The symbol ":=" was substituted for "(" to continue.
    ERROR 103
    1 row selected.
    Elapsed: 00:00:00.01
    SQL> grant execute on XDB_EXAMPLES to public
    2 /
    Grant succeeded.
    Elapsed: 00:00:00.03
    SQL> create or replace public synonym XDB_EXAMPLES for XDB_EXAMPLES
    2 /
    Synonym created.
    Elapsed: 00:00:00.00
    SQL> connect &1/&2
    Connected.
    SQL> --
    SQL> declare
    2 targetFile BFILE;
    3 content BLOB;
    4 begin
    5 targetFile := BFILENAME(USER,'&4');
    6 DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
    7 DBMS_LOB.createTemporary(content,true,DBMS_LOB.SESSION);
    8 DBMS_LOB.loadFromFile(content,targetFile,dbms_lob.getLength(targetFile),1,1);
    9 XDB_EXAMPLES.updateResource('/home/&1/&3',content);
    10 DBMS_LOB.freeTemporary(content);
    11 DBMS_LOB.fileclose(targetFile);
    12 commit;
    13 end;
    14 /
    old 5: targetFile := BFILENAME(USER,'&4');
    new 5: targetFile := BFILENAME(USER,'Concorde.jpg');
    old 9: XDB_EXAMPLES.updateResource('/home/&1/&3',content);
    new 9: XDB_EXAMPLES.updateResource('/home/XDBTEST/RedwoodShores.jpg',content);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.77
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    open mdrake-lap 2100
    user XDBTEST XDBTEST
    cd /home/XDBTEST
    ls -l
    get "RedwoodShores.jpg" "output2.jpg"
    quit
    Connected to mdrake-lap.
    220 mdrake-lap FTP Server (Oracle XML DB/Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    331 pass required for XDBTEST
    230 XDBTEST logged in
    250 CWD Command successful
    200 PORT Command successful
    150 ASCII Data Connection
    -rw-r--r-- 1 XDBTEST oracle 235782 MAR 22 10:13 RedwoodShores.jpg
    drw-r--r-- 2 XDBTEST oracle 0 MAR 22 10:13 xsd
    226 ASCII Transfer Complete
    ftp: 132 bytes received in 0.00Seconds 132000.00Kbytes/sec.
    200 PORT Command successful
    150 ASCII Data Connection
    226 ASCII Transfer Complete
    ftp: 235782 bytes received in 0.22Seconds 1071.74Kbytes/sec.
    221 QUIT Goodbye.
    -rwxrwxrwa 1 mdrake None 235782 Aug 9 2003 Concorde.jpg
    -rwxrwxrwa 1 mdrake None 352071 Aug 9 2003 RedwoodShores.jpg
    -rwxrwxrwa 1 mdrake None 352071 Mar 22 11:14 output1.jpg
    -rwxrwxrwa 1 mdrake None 235782 Mar 22 11:14 output2.jpg
    $
    $

  • Problem at update blob columns.

    Hi,i have a table like this.
    create table customer
    (id number,
    photo blob,
    sign blob,
    pass_view blob);
    I have a form based to this table (at 9i) which has 3 image item.
    By using webutil i read image files to this items and after commit i stored them to database.There is no problem up to this time,inserting data to database seems correct.
    Now i want to update an imge from database and I open form again and execute query.All 3 images was seen.I changed 3rd pass_view image again by reading another image file from file system.After commit and execute_query again i understood that photo column is now having new pass_view image and pass_view column is null.
    In trying different loading to different images,i have problems again.
    Only if i read 3 images from 3 files to image items again,i have no problem in updating.
    Is there a problem in having 3 blob columns in a table?

    I have the problem even with 2 images (2 BLOB fields in table).
    Forms application updates the first image if you replace only the second image. If you replace both images everything is correct.
    Honestly speaking I have this problem with 9.0.2 version and probably in couple weeks I'll test it on 9.0.4.
    Thanks
    Vitaliy

  • BLOBDestination. Problem in updating BLOB field

    hi,
    Im trying to customize BLOBDestination package to update a BLOB field. So I modified the method insertBLOB replacing the insert statement with this
    stmtStr = "UPDATE " + " " + tab + " " + "SET "+ "'" blobCol "'=" + "'" + "empty_blob()" + "'"+ "WHERE " + "'"+keyCol+"'=" + "'" + key+ "'" ;
    stmt.executeUpdate(stmtStr);
    calling BLOBDestination from form I got this stmtStr:
    UPDATE MYTABLE SET blob_field=empty_blob() WHERE col1 = 'val1' (copied from OC4J_BI_Forms log file)
    but the execution returns this error:
    REP-50125: blobdestination : exception: java.sql.SQLException: ORA-00933: SQL command not properly ended
    I can affirm that the statement works if executed from TOAD or SQL*Plus
    what's wrong?

    It depends on how you have your table control set up.  When you say that you are updating the table control field, are you updating the value of the field wherever the table control data is being pulled from (I.e. the original table)?  Or are you updating the value in the internal table that is part of the table control definition (I.e. the field shown within the table control if you look at the screen layout)?  Make sure that if you are changing the data in the original table that you then also update the actual table control fields as well.  Also, are you making your changes in the PBO module before the screen is ever displayed?  You may need to use a MODIFY SCREEN statement after you make your changes, depending on when your code is called.  I hope this helps.
    - April King

  • Update blob image

    Hi all,
    I have a table with a blob column.
    I need to update all blobs.
    When I try to execute the following, an error occurs:
    declare
            l_blob    BLOB;
            l_bfile   BFILE:=BFILENAME('MY_DIR', 'image.gif');
    begin
          UPDATE tab_image SET img = EMPTY_BLOB()
          WHERE  no_tab_image = 'HEADER'
                    RETURNING img INTO l_blob;
          dbms_lob.fileopen(l_bfile);
          dbms_lob.loadfromfile(l_blob,l_bfile,dbms_lob.getlength(l_bfile));
          dbms_lob.fileclose(l_bfile);
    end;
    /The error is:
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 5How can I solve this?
    thank U very much!
    []´s

    You have more than one record which matches the criteria
          WHERE  no_tab_image = 'HEADER'whuich will cause the RETURNING clause to fail. Your options are to remove the returning clause or to use a RETURNING BULK COLLECT clause into an array.
    Quite why you are returning the BLOB you are setting to be empty is beyond me, so I supect you should go for the first option and do away with the RETURNING clause altogether.
    Cheers, APC

  • OCI_INVALID_HANDLE at updating BLOB/CLOB in PHP

    Hi all,
    I tried this question also in the OCI forum, but due to no response I try it here.
    We're busy with implementing Typo3 (OpenSource CMS in PhP) on Oracle (XE universal).
    We're running in a OCI_INVALID_HANDLE problem during page refreshes (CTRL-Refresh).
    The actual error is:
    Warning: OCI-Lob::save() http://oci-lob.save: OCI_INVALID_HANDLE in /var/www/sources/typo3_src-4.2.10/typo3/sysext/adodb/adodb/drivers/adodb-oci8.inc.php on line 696
    The piece of code where it refers to is:
    function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
    //if (strlen($val) < 4000) return $this->Execute("UPDATE $table SET $column=:blob WHERE $where",array('blob'=>$val)) != false;
    switch(strtoupper($blobtype)) {
    default: ADOConnection::outp("UpdateBlob: Unknown blobtype=$blobtype"); return false;
    case 'BLOB': $type = OCI_B_BLOB; break;
    case 'CLOB': $type = OCI_B_CLOB; break;
    if ($this->databaseType == 'oci8po')
    $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO ?";
    else
    $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO :blob";
    $desc = OCINewDescriptor($this->connectionID, OCID_LOB);
    $arr = array($desc,-1,$type);
    if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=EXACT');
    $commit = $this->autoCommit;
    if ($commit) $this->BeginTrans();
    $rs = $this->_Execute($sql,$arr);
    if ($rez = !empty($rs)) $desc->save($val); ##################### this is line 696
    $desc->free();
    if ($commit) $this->CommitTrans();
    if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=FORCE');
    if ($rez) $rs->Close();
    return $rez;
    I've googled around for some time and also queried this forum, but could not find any suggestions. To me it seems quite ok what is done here. And it is some standard Typo3 code.
    Could you please shine your light upon it and maybe give me some ideas to solve this?
    Thank you very much.
    Regards,
    Martien
    Edited by: Martien van den Akker on Dec 4, 2009 1:39 PM

    See my answer to your other post, inserting a text file into a clob field

Maybe you are looking for

  • Estoque alocado em ordem de cliente

    Srs, Tenho materiais em meu estoque que pertencem a terceiros e estão em meu poder. Atualmente, estes materiais estão alocados como ordem de cliente em livre utilização. Preciso enviar estes materiais para reparo externo, porém, quando seleciono o lo

  • Help needed in Finding Download location for Sun One Portal 7

    Hi, help needed for finding download location for Sun ONE Portal 7. I tried to find in Oracle Download page , http://www.oracle.com/us/sun/sun-products-map-075562.html, But unable to find. Please share the link for download location. I am totally new

  • Is anyone else having problems with iMessages?

    It stopped working randomly and now says keep waiting for activation... Is it Apple's problem? Does anyone know how to fix it? Thanks

  • Wls 9.1 doesn't pick up changes to static content in production mode

    Hi Everybody,           I'm running wls 9.1 on XP in production mode as a stand-alone server. My web app is deployed in exploded format in an external directory.           I'm trying to force the server to pick up the changes to static content like J

  • HELP installing new version of iTunes to PC

    I keep getting this error message when attempting to install iTunes to my PC. "This installer is intended for 32bit versions of Windows. Please download and install the 64bit iTunes installer instead