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

Similar Messages

  • 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

  • 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

  • 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.

  • 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.

  • How do I prevent Security Updates from overwriting (custom) PHP install?

    Hi,
    I've been forced into re-installing PHP from binaries after every Apple Security Update that upgrades PHP and I'm over it. Everytime Apple upgrades PHP, "their" compile overwrites mine and I lose my libraries. I have to completely wipe the Apple PHP install and re-compile. I've done this 3 or 4 times now in the past couple years...
    Is there any way to force the Security Updates to retain the install of "my" libraries? What about the update installer(s)? Where are they?
    12" PB 1.25   Mac OS X (10.3.9)  

    An Update shouldn't affect PHP, this is a server side language that is stored on the server for the implamintation of Dynamic Web Pages.
    Self-referentially short for PHP: Hypertext Preprocessor, an open source, server-side, HTML embedded scripting language used to create dynamic Web pages.
    In an HTML document, PHP script (similar syntax to that of Perl or C ) is enclosed within special PHP tags. Because PHP is embedded within tags, the author can jump between HTML and PHP (similar to ASP and Cold Fusion) instead of having to rely on heavy amounts of code to output HTML. And, because PHP is executed on the server, the client cannot view the PHP code.
    PHP can perform any task that any CGI program can do, but its strength lies in its compatibility with many types of databases. Also, PHP can talk across networks using IMAP, SNMP, NNTP, POP3, or HTTP.
    PHP was created sometime in 1994 by Rasmus Lerdorf. During mid 1997, PHP development entered the hands of other contributors. Two of them, Zeev Suraski and Andi Gutmans, rewrote the parser from scratch to create PHP version 3 (PHP3).
    Don

  • 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();

  • Update current date in mysql using Update form DW CS4 PHP

    I have a field called datePosted that is set to curdate in the database.  What I want to do is when the checkbox on this form called approved is checked, and the form is submitted, I want that dateApproved field to update to the current date in the database.  When I have tried it, it says zero.  I have tried setting a variable and using now() but cant get it to change on update.
    Here is the form
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
        <table align="center">
          <tr valign="baseline">
            <td nowrap="nowrap" align="right">JobName:</td>
            <td><input type="text" name="jobName" value="<?php echo htmlentities($row_rs_crave['jobName'], ENT_COMPAT, 'UTF-8'); ?>" size="32" /></td>
          </tr>
          <tr valign="baseline">
            <td nowrap="nowrap" align="right" valign="top">Description:</td>
            <td><textarea name="description" cols="50" rows="5"><?php echo htmlentities($row_rs_crave['description'], ENT_COMPAT, 'UTF-8'); ?></textarea></td>
          </tr>
          <tr valign="baseline">
            <td nowrap="nowrap" align="right">State:</td>
            <td><select name="state">
              <option value="h" <?php if (!(strcmp("h", htmlentities($row_rs_crave['state'], ENT_COMPAT, 'UTF-8')))) {echo "SELECTED";} ?>>hh</option>
            </select></td>
          </tr>
          <tr valign="baseline">
            <td nowrap="nowrap" align="right">FleetID:</td>
            <td><input type="text" name="fleetID" value="<?php echo htmlentities($row_rs_crave['fleetID'], ENT_COMPAT, 'UTF-8'); ?>" size="32" /></td>
          </tr>
          <tr valign="baseline">
            <td nowrap="nowrap" align="right">Approved:</td>
            <td><input type="checkbox" name="approved" value=""  <?php if (!(strcmp(htmlentities($row_rs_crave['approved'], ENT_COMPAT, 'UTF-8'),""))) {echo "checked=\"checked\"";} ?> /></td>
          </tr>
          <tr valign="baseline">
            <td nowrap="nowrap" align="right">DatePosted:</td>
            <td><input type="text" name="datePosted" value="<?php echo htmlentities($row_rs_crave['datePosted'], ENT_COMPAT, 'UTF-8'); ?>" size="32" /></td>
          </tr>
          <tr valign="baseline">
            <td nowrap="nowrap" align="right"> </td>
            <td><input type="submit" value="Update record" /></td>
          </tr>
        </table>
        <input type="hidden" name="jobid" value="<?php echo $row_rs_crave['jobid']; ?>" />
        <input type="hidden" name="MM_update" value="form1" />
      </form>
    And they sql
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
      $updateSQL = sprintf("UPDATE crave SET jobName=%s, `description`=%s, `state`=%s, fleetID=%s, approved=%s, datePosted=%s WHERE jobid=%s",
                           GetSQLValueString($_POST['jobName'], "text"),
                           GetSQLValueString($_POST['description'], "text"),
                           GetSQLValueString($_POST['state'], "text"),
                           GetSQLValueString($_POST['fleetID'], "int"),
                           GetSQLValueString(isset($_POST['approved']) ? "true" : "", "defined","1","0"),
                           GetSQLValueString($_POST['datePosted'], "date"),
                           GetSQLValueString($_POST['jobid'], "int"));

    Change the SQL like this:
    // Check whether the approved checkbox has been selected
    $_POST['approved'] = isset($_POST['approved']) ? 1 : 0;
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
    $updateSQL = sprintf("UPDATE crave SET jobName=%s, `description`=%s,
    `state`=%s, fleetID=%s, approved=%s, datePosted=%s WHERE jobid=%s",
                           GetSQLValueString($_POST['jobName'], "text"),
                           GetSQLValueString($_POST['description'], "text"),
                           GetSQLValueString($_POST['state'], "text"),
                           GetSQLValueString($_POST['fleetID'], "int"),
                           GetSQLValueString(isset($_POST['approved']), "defined","NOW()","approved"),
                           GetSQLValueString($_POST['datePosted'], "date"),
                           GetSQLValueString($_POST['jobid'], "int"));
    What that does is check whether the approved checkbox has been selected. If it has, $_POST['approved'] is set to 1 (true); if not, it's set to 0 (false).
    In the GetSQLValueString() function, the value is set to NOW() if the checkbox has been selected. Otherwise, the existing value in the approved column is reassigned.

  • 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

  • Update query error in php

    please help.
    I ran the query below in php4 + oacle9i
    <?php
    $quantity = 12345;
    $grace=20;
    $conn = ociLogon('username', 'pwd','host');
    if (!$conn) {
    $e = ocierror();
    print htmlentities($e['message']);
    exit;
    $query = "udpate product set status_dtm = (status_dtm)+20 where product_no = $quantity";
    $stid = ociparse($conn, $query);
    if (!$stid) {
    $e = ocierror($conn);
    print htmlentities($e['message']);
    exit;
    $r = ociexecute($stid, OCI_DEFAULT);
    if (!$r) {
    $e = ocierror($stid);
    echo htmlentities($e['message']);
    exit;
    print '<table border="1">';
    while (ocifetchinto($stid, $row, OCI_ASSOC)) {
    print '<tr>';
         foreach ($row as $item) {
    print '<td>'.($item?htmlentities($item):' ').'</td>';
    print '</tr>';
    print '</table>';
    ociLogoff($conn);
    ?>
    it throws error , but it throws this error
    Warning: ociexecute() [function.ociexecute]: OCIStmtExecute: ORA-00900: invalid SQL statement in C:\Program Files\IBM HTTP Server 2.0\htdocs\en_US\welcome.php on line 40
    ORA-00900: invalid SQL statement

    $query = "udpate product set status_dtm =
    (status_dtm)+20 where product_no = $quantity";It says "udpate" instead of "update" :-)

  • 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
    $
    $

Maybe you are looking for

  • Retrieve Specific Mapping Error Information Within BPM Flow.

    I have an Integration Process which executes a message mapping step prior to further processing. When the message mapping receives an error there is an exception branch within the process that will send an email using the Mail Receiver Adapter. The m

  • SAP HR OM@TRAINING&EVENTMANAGEMENT

    HI EVERYBODY,           I WANT TO DEVELOP A REPORT THAT CREATES INDIVIDUAL CERTIFICATES ,FOR EACH ATTENDEE I NEED TO GENERATE A SEPARATE WORD DOCUMENT IN THE SPECIFIED DIRECTIOY,THE CERTIFICATE LOOKS LIKE   THIS IS TO CERTIFY THAT STUDENT NAME HERE H

  • How to extract CRM Install Base's serial # to BW?

    Hello Gurus,    I'm working on CRM services area. Now the questions is I have a requirement to extract Install Base's equipment serial number to BW. In a service order I can get Component number. With that component number I can go to IB53 tcode and

  • Pooled table

    how pooled table stored in database table?plzz tell

  • Oracle Designer 9i

    Hi Can anyone help me to find Oracle Designer 9i to run on Windows 2000? Download link or CD would be fine. Thanks