Unable to read BLOB column

Hi,
I want to read data in text format from the BLOB column
XML_col is the column with BLOB datatype in TEST table.
select BLOB2VARCHAR(XML_col) from TEST;
I created BLOB2VARCHAR function to convert from BLOB to Varchar.
CREATE OR REPLACE FUNCTION TEST_fnc (html IN BLOB)
RETURN VARCHAR2
IS
tmpvar NUMBER;
tmpchr VARCHAR2 (4000);
BEGIN
tmpchr := UTL_RAW.cast_to_varchar2 (DBMS_LOB.SUBSTR (html, 4000, 1));
tmpchr := SUBSTR (tmpchr, 1, 4000);
RETURN tmpchr;
EXCEPTION
WHEN OTHERS
THEN
RETURN NULL;
END blob2varchar;
I am getting output as ’
Which i guess is wrong.

Hi,
This will print your output character by character
Try this and let me know
DECLARE
   v_read_bytes  BINARY_INTEGER;
   v_pos         INTEGER;
   v_blob_len    INTEGER;
   v_buffer      RAW(200);
   v_file_data   fnd_lobs.file_data%TYPE;
BEGIN
         SELECT file_data
           INTO v_file_data
           FROM fnd_lobs
          WHERE file_id = 121708;
         v_blob_len    := DBMS_LOB.getLength (v_file_data);
         v_pos         := 0;
         v_read_bytes  := 1;
         WHILE v_pos <= v_blob_len
         LOOP
            v_pos         := v_pos +  1;
            DBMS_LOB.read (v_file_data, v_read_bytes, v_pos, v_buffer);
            DBMS_OUTPUT.PUt_line(utl_raw.cast_to_varchar2(v_buffer));
         END LOOP;
END;

Similar Messages

  • Sql Server 2014 - Error message: Failed to read BLOB column

    Hi all,
      Am experiencing this error in Microsoft SQL Server 2014 - 12.0.2000.8 (X64) Enterprise Edition (Build 7601: Service Pack 1).
    Error messages:
    Message: Failed to read BLOB column
    Stack:    at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowNativeBcpOutException(CConnection* pNativeConnectionWrapper)
       at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.BcpOut(String strBcpObjectName, String strBcpObjectOwner, String strBaseBcpObjectName, Boolean fUnicodeConversion, String strDataFile, String strLoadOrderingHint, String
    strWhereClause, Boolean useTableLockHint, Int32 bcpFileFormatVersion)
       at Microsoft.SqlServer.Replication.Snapshot.SqlServer.BcpOutThreadProvider.DoWork(WorkItem workItem)
       at Microsoft.SqlServer.Replication.WorkerThread.NonExceptionBasedAgentThreadProc()
       at Microsoft.SqlServer.Replication.AgentCore.BaseAgentThread.AgentThreadProcWrapper() (Source: MSSQLServer, Error number: 0)
    Get help: http://help/0
    Message: Shared Memory Provider: No process is on the other end of the pipe.
    Stack:  (Source: MSSQLServer, Error number: 233)
    Get help: http://help/233
    Message: Communication link failure
    Stack:  (Source: MSSQLServer, Error number: 233)
    Get help: http://help/233
    Message: Shared Memory Provider: No process is on the other end of the pipe.
    Stack:  (Source: MSSQLServer, Error number: 233)
    Get help: http://help/233
    Message: Communication link failure
    Stack:  (Source: MSSQLServer, Error number: 233)
    Get help: http://help/233
    Please can you assist me on this issue.

    The error message states a communication link failure has occurred. 
    This is most likely a network related error and usually is transient.
    Try to generate the snapshot again and see if the error still occurs.  If the error still occurs, you will need to have a network admin check the links.
    Brandon Williams (blog |
    linkedin)

  • How to read BLOB column from a table in SQL or PL/SQL

    I have table which is having one BLOB data type column . Ihave inserted few rows in that table . Now i want to see wheather BLOB column has been inserted properly or not . How to read that column through SQL or PL/SQL.
    Can anyone help me to do this.

    You can only manipulate LOBs in PL/SQL because you have to use the DBMS_LOB package.
    Check out the Oracle Developer's Guide

  • Stuck threads reading blob column from db table

    WLS 10.3.5, JDK 1.6u29, Oracle 11g RAC, ojdbc6 latest driver
    We're having problems with stuck threads trying to read a blob column from a DB table. The query to extract the blob is a simple select, without any locking such as "for update" clauses or whatever. The blob's size is <= 100k.
    The thread dump shows the following stack trace:
    +"[STUCK] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE native+
    +     java.net.SocketInputStream.socketRead0(Native Method)+
    +     java.net.SocketInputStream.read(SocketInputStream.java:129)+
    +     oracle.net.ns.Packet.receive(Packet.java:300)+
    +     oracle.net.ns.DataPacket.receive(DataPacket.java:106)+
    +     oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:315)+
    +     oracle.net.ns.NetInputStream.read(NetInputStream.java:260)+
    +     oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:105)+
    +     oracle.jdbc.driver.T4CMAREngine.getNBytes(T4CMAREngine.java:1517)+
    +     oracle.jdbc.driver.T4C8TTILobd.unmarshalLobData(T4C8TTILobd.java:476)+
    +     oracle.jdbc.driver.T4C8TTILob.readLOBD(T4C8TTILob.java:770)+
    +     oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:361)+
    +     oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)+
    +     oracle.jdbc.driver.T4C8TTILob.read(T4C8TTILob.java:146)+
    +     oracle.jdbc.driver.T4CConnection.getBytes(T4CConnection.java:2392)+
    +     oracle.sql.BLOB.getBytes(BLOB.java:348)+
    +     oracle.sql.BLOB.getBytes(BLOB.java:222)+
    +     weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB.getBytes(Unknown Source)+
    +     com.ibatis.sqlmap.engine.type.BlobTypeHandlerCallback.getResult(BlobTypeHandlerCallback.java:33)+
    +     com.ibatis.sqlmap.engine.type.CustomTypeHandler.getResult(CustomTypeHandler.java:52)+
    +     com.ibatis.sqlmap.engine.mapping.result.ResultMap.getPrimitiveResultMappingValue(ResultMap.java:619)+
    +     com.ibatis.sqlmap.engine.mapping.result.ResultMap.getResults(ResultMap.java:345)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:384)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:300)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:189)+
    +     com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221)+
    +     com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189)+
    +     com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:94)+
    +     com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(SqlMapDaoTemplate.java:282)"[STUCK] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE native+
    +     java.net.SocketInputStream.socketRead0(Native Method)+
    +     java.net.SocketInputStream.read(SocketInputStream.java:129)+
    +     oracle.net.ns.Packet.receive(Packet.java:300)+
    +     oracle.net.ns.DataPacket.receive(DataPacket.java:106)+
    +     oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:315)+
    +     oracle.net.ns.NetInputStream.read(NetInputStream.java:260)+
    +     oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:105)+
    +     oracle.jdbc.driver.T4CMAREngine.getNBytes(T4CMAREngine.java:1517)+
    +     oracle.jdbc.driver.T4C8TTILobd.unmarshalLobData(T4C8TTILobd.java:476)+
    +     oracle.jdbc.driver.T4C8TTILob.readLOBD(T4C8TTILob.java:770)+
    +     oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:361)+
    +     oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)+
    +     oracle.jdbc.driver.T4C8TTILob.read(T4C8TTILob.java:146)+
    +     oracle.jdbc.driver.T4CConnection.getBytes(T4CConnection.java:2392)+
    +     oracle.sql.BLOB.getBytes(BLOB.java:348)+
    +     oracle.sql.BLOB.getBytes(BLOB.java:222)+
    +     weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB.getBytes(Unknown Source)+
    +     com.ibatis.sqlmap.engine.type.BlobTypeHandlerCallback.getResult(BlobTypeHandlerCallback.java:33)+
    +     com.ibatis.sqlmap.engine.type.CustomTypeHandler.getResult(CustomTypeHandler.java:52)+
    +     com.ibatis.sqlmap.engine.mapping.result.ResultMap.getPrimitiveResultMappingValue(ResultMap.java:619)+
    +     com.ibatis.sqlmap.engine.mapping.result.ResultMap.getResults(ResultMap.java:345)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:384)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:300)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:189)+
    +     com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221)+
         com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189)
    +     com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:94)+
    +     com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(SqlMapDaoTemplate.java:282)+
    Some threads eventually end (after 1-2 hours), most of them remain there for days.
    Any hint would be quite useful, thanks.

    Threads are executing the actual allocated request from the Weblogic Kernel. Most of the problems happen when the Thread execution is reaching the application or business layer.
    At this point your application Java code module is sending or receiving data from external sources such as a an Oracle database for example. Any problem with such external system will cause the Thread to hang and wait for data to come back.
    Other situations can occur such as internal deadlock, infinite looping, heavy IO contention on your server etc.
    Doesn't loo like a driver issue.
    http://docs.oracle.com/cd/E21764_01/doc.1111/e14770/weblogic_server_issues.htm#autoId2
    Check at the Database end
    Cheers ...

  • Unable to read blob attributes in the Asset Filter

    Hi,
    I am unable to read a blob attribute in the Asset Filter using the following code.
    The String attributes work fine.
    Can I get some examples for reading blob attributes in the filter?
    I am using Webcenter Sites 11gr1
    public void filterAsset(IFilterEnvironment env, String filterIdentifier, FTValList filterArguments, IFilterableAssetInstance instance) throws AssetException
    String inputattr = getAttrID(env, filterArguments, ARG_CUSTOM[0]);
    IListBasic ilistbasic = instance.getAttribute(inputattr);
    ilistbasic.getValue("value") // throws No such field exception.. works fine for string attribues
    Thanks,
    Raj

    Hi
    In DTP, Filter there is option to write routine. The last button.
    Here u can write the below code :
    Select <fields> from table into itab.
    Read itab into wa_itab where <condition>.
    If sy_subrc = 0.
         l_t_range-FIELDNAME = ' '. <give ur field name in source>
          l_t_range-sign = 'I'.
          l_t_range-option = 'EQ'.
          l_t_range-low = wa_itab-field.
        APPEND L_T_RANGE.
    endif.

  • Unable to read last column in FCC

    Hi Experts,
    I have a simple fcc to bapi scenario....
    I have two questions
    Firstly ..what is the limit on the number of fields , I mean number of columns in the input file????
    Secondly.. Im facing a strange issue where the last column is not being read if it empty , and being read (as i see it in comm channel monitoring) only when it has a value...
    Pls share ur thoughts

    Hi Teja,
    > Firstly ..what is the limit on the number of fields , I mean number of columns in the input file????
    There is no limit, you can use any number of fields based on your requirements.
    > Secondly.. Im facing a strange issue where the last column is not being read if it empty , and being read (as i see it in comm >channel monitoring) only when it has a value...
    If you want to read that fields always(if value is there or not) then in the mapping use map with default node function.
    More info check this link
    http://help.sap.com/saphelp_srm40/helpdata/ru/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    Regards
    Ramesh

  • ORA_FFI and BLOB columns

    I'm trying to find dll library, which can write and read blob column? Can anybody help me?

    Shay, thanks for your reply.
    Is my interpretation of your advice correct?
    1. I need to use Java to replace the Delphi dll to allow me to copy/paste the client clipboard to/from a file.
    2. If the file is on the client then I will also need to use Java in place of text_io to read from the file.
    3. Could I use Java to copy to/paste from the client clipboard to a server file. That way I would not need to change the text_io code?
    Thanks
    Stewart

  • How to read/write a binary file from/to a table with BLOB column

    I have create a table with a column of data type BLOB.
    I can read/write an IMAGE file from/to the column of the table using:
    READ_IMAGE_FILE
    WRITE_IMAGE_FILE
    How can I do the same for other binary files, e.g. aaaa.zip?

    There is a package procedure dbms_lob.readblobfromfile to read BLOB's from file.
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#sthref3583
    To write a BLOB to file you can use a Java procedure (pre Oracle 9i R2) or utl_file.put_raw (there is no dbms_lob.writelobtofile).
    http://asktom.oracle.com/pls/ask/f?p=4950:8:1559124855641433424::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:6379798216275

  • How to read a XML file from BLOB column and insert in a table - PL/SQL Only

    Hi,
    To make data load more simple to end user instead placing file on the server and use SQL-LOADER, I came up with new idea that using oracle ebusiness suite attachment functionality. that loads a XML file from local PC to a database column(table is fnd_attachments, default data type is BLOB over here).
    I tried with DBMS_LOB and didnt get around.
    Please can anyone tell me how to read the BLOB column using PL/SQL and store the data in a oracle table. Here's the sample XML file and table structure FYI.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Corporate_alloc.xsd" generated="2009-07-07T14:17:49">
    <Corporate_alloc>
    <PKG_CODE>BKCORP</PKG_CODE>
    <PKG_NAME>Corporate Edition - Books</PKG_NAME>
    <DET_CODE>B9780080543758</DET_CODE>
    <DET_NAME>Waves, Tides and Shallow-Water Processes</DET_NAME>
    <ALLOCATION_RATIO>0.000041</ALLOCATION_RATIO>
    </Corporate_alloc>
    <Corporate_alloc>
    <PKG_CODE>BKCORP</PKG_CODE>
    <PKG_NAME>Corporate Edition - Books</PKG_NAME>
    <DET_CODE>B9780080534343</DET_CODE>
    <DET_NAME>Hydrostatically Loaded Structures</DET_NAME>
    <ALLOCATION_RATIO>0.000127</ALLOCATION_RATIO>
    </Corporate_alloc>
    </dataroot>
    CREATE TABLE TEST_XML
    ( PKG_CODE VARCHAR2(50),
    PKG_NAME VARCHAR2(100),
    DET_CODE VARCHAR2(20),
    DET_NAME VARCHAR2(500),
    ALLOCATION_RATIO NUMBER )
    Thanks
    EBV

    In regards to #3, use the COLUMNS functionality of XMLTable instead of using Extract. Two simple examples are
    Re: XML Data - Caliculate fields
    Re: Extractvalue function not recognised

  • Reading and Writing to blob column is very slow

    Hi
    I want to write a serialized java object called 'engine' to a database table called javaObjectsDB. The serialized object could be of sizes anywhere between 20MB to 4GB. I am using the following code to write this 'engine' object
                   * Write java object to BLOB in DB - Start
                   Connection conn=null;
                   conn = Util.getConnectionFromDS();
              PreparedStatement ps=null;
              String sql=null;
                   Engine.startWatch();
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   Engine.endWatch("Time for ByteArrayOutputStream");
                   Engine.startWatch();
                   ObjectOutputStream oos = new ObjectOutputStream(baos);
                   Engine.endWatch("Time for ObjectOutputStream");
                   Engine.startWatch();
                   oos.writeObject(this.engine_);
                   Engine.endWatch("Time for oos.writeObject");
                   oos.flush();
                   Engine.startWatch();
                   byte[] data = baos.toByteArray(); // in case of using ByteArrayOutputStream
                   Engine.endWatch("Time for toByteArray");
                   Engine.startWatch();
         sql="insert into javaObjectsDB values (?)";
         ps=conn.prepareStatement(sql);
         ps.setObject(1, data); // in case of using ByteArrayOutputStream
         ps.executeUpdate();
         Engine.endWatch("Time for prepare statement and insert");
                   * Write java object to BLOB in DB - End
    To read from database BLOB column back to the engine object I use the following code:
    try {
                   String readBlob = "SELECT javaObject FROM javaObjectsDB ";
                   Statement readBlobStmt = conn.createStatement();
                   ResultSet resultSet = readBlobStmt.executeQuery(readBlob);
                   while (resultSet.next()) {
                        * ByteArrayStream *** Start
                        Engine.startWatch();
                        Blob blob = resultSet.getBlob(1);
                        Engine.endWatch("loadPlan::Time for getBlob");
                        Engine.startWatch();               
                        byte [] data = blob.getBytes(1,(int)blob.length());
                        Engine.endWatch("loadPlan::Time for getBytes");                    
                        Engine.startWatch();
                   ByteArrayInputStream bais = new ByteArrayInputStream(data);               
                   Engine.endWatch("loadPlan::Time for ByteArrayInputStream");
                   Engine.startWatch();
                   ObjectInputStream oin = new ObjectInputStream(bais);
                   Engine.endWatch("loadPlan::Time for ObjectInputStream");
                   Engine.startWatch();
                   engine_ = (Engine)oin.readObject();     
                   Engine.endWatch("loadPlan::Time for oin.readObject");
                   System.out.println("engine object prepared");
                        * ByteArrayStream *** End
                   } //while of result Set
    The time taken to write and read for a engine object of size 124MB are:
    write - 41secs
    read - 28secs
    For a engine object of size 340MB
    write - 3minutes
    read - 1minute
    This is a lot of time for such small object size, and since we are expecting sizes of 4GB, I need to have better performance. Please suggest what I can do to improve performance for read and write.
    One thing I tried was using cached lobs but not of much use.

    Welcome to the forum!
    Unfortunately this is an Oracle forum and your question should be posted in the Java JDBC forum.
    https://forums.oracle.com/forums/category.jspa?categoryID=288
    Please create a question on the JDBC forum, post a link to that new question here, in this forum, and mark this question answered.
    That way anyone seeing this question can followup with you in the other forum.
    Thanks.

  • How to read the blob column?

    Hi,
    i wanted to store the zip file in a blob column and i also want to download the file
    i have tried in the following manner
    -- Creation of the table
    create table demo
    ( ID int,
    theblob blob);
    --insert the zip file into the table
    declare
    l_blob blob;
    l_bfile bfile;
    begin
    insert into demo values ( 5, empty_blob() )
    returning theBlob into l_blob;
    l_bfile := bfilename( 'MWDIR_TST', 'demo.zip' );
    dbms_lob.fileopen( l_bfile );
    dbms_lob.loadfromfile( l_blob, l_bfile,
    dbms_lob.getlength( l_bfile ) );
    dbms_lob.fileclose( l_bfile );
    end;
    -- Function to convert the blob into clob
    CREATE OR REPLACE FUNCTION XBLOB_To_CLOB(L_BLOB BLOB) RETURN CLOB IS
    L_CLOB               CLOB;
    L_SRC_OFFSET     NUMBER;
    L_DEST_OFFSET     NUMBER;
    L_BLOB_CSID          NUMBER := DBMS_LOB.DEFAULT_CSID;
    V_LANG_CONTEXT     NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
    L_WARNING          NUMBER;
    L_AMOUNT          NUMBER;
    BEGIN
    IF DBMS_LOB.GETLENGTH(L_BLOB) > 0 THEN
    DBMS_LOB.CREATETEMPORARY(L_CLOB, TRUE);
    L_SRC_OFFSET := 1;
    L_DEST_OFFSET := 1;
    L_AMOUNT := DBMS_LOB.GETLENGTH(L_BLOB);
    DBMS_LOB.CONVERTTOCLOB(L_CLOB,
    L_BLOB,
    L_AMOUNT,
    L_SRC_OFFSET,
    L_DEST_OFFSET,
    1,
    V_LANG_CONTEXT,
    L_WARNING);
    RETURN L_CLOB;
    ELSE
    L_CLOB:= TO_CLOB('');
    RETURN L_CLOB;
    End IF;
    DBMS_LOB.FREETEMPORARY(L_CLOB);
    END XBLOB_To_CLOB;
    -- Procedure to wtire clob into file
    CREATE OR REPLACE PROCEDURE Write_CLOB_To_File ( directory_name varchar2,filename varchar2, clob_loc CLOB )
    IS
    buffer VARCHAR2(32767);
    buffer_size CONSTANT BINARY_INTEGER := 32767;
    amount BINARY_INTEGER;
    offset NUMBER(38);
    file_handle UTL_FILE.FILE_TYPE;
    BEGIN
    file_handle := UTL_FILE.FOPEN(location => directory_name,filename => filename,open_mode => 'w',max_linesize => buffer_size);
    amount := buffer_size;
    offset := 1;
    -- READ FROM CLOB / WRITE OUT TO DISK
    WHILE amount >= buffer_size
    LOOP
    DBMS_LOB.READ(lob_loc => clob_loc,amount => amount,offset => offset,buffer => buffer);
    buffer:=replace(buffer,chr(13),'');
    offset := offset + amount;
    UTL_FILE.PUT(file => file_handle,buffer => buffer);
    UTL_FILE.FFLUSH(file => file_handle);
    END LOOP;
    UTL_FILE.FCLOSE(file => file_handle);
    END Write_CLOB_To_File;
    -- To execute use the following example
    declare TmpClob CLOB;
    begin
    select XBLOB_TO_CLOB(theblob) into TmpClob from demo where id=5;
    Write_Clob_To_File('TEMP','demo.txt',TmpClob);
    end;
    when i am excuting the above code it is not bringing the exact binary values from the database ?
    can any one help me on this?
    Thanks
    Rangan S

    On another note it's always a good idea to tell us what database version you are using e.g. 9.2.0.7 or 10.2.0.3 etc. as this will allow us to tailor our answers appropriately in case there are features we can't use because you are using an older version.
    And, when posting code, please put {noformat}{noformat} tags around it so that it keeps its formatting on the forum.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Index creation on Blob column

    I am new to InterMedia. I am trying to create an index on a blob column. I am getting a error -
    Can you please suggest me the solution of this problem.
    Thanks.......
    The following statement(s) failed to execute successfully.
    CREATE INDEX temp.ind1 ON temp.student(MOL) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('')
    ORA-29855: error occurered in the execution of ODCINDEXCREATE routine
    ORA-20000: interMedia Text error:
    DRG-50704: Net8 listener is not running or cannot start external procedures
    ORA-28575: unable to open RPC connection to external procedure agent
    ORA-06512: at "CTXSYS.DRUE", line 122
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 34
    ORA-06512: at line 1
    null

    Listner problems probably. Please check the FAQ at http://technet.oracle.com/products/text/

  • Inserting Image into a BLOB column in Oracle9i

    Hi,
    I am unable to insert image into a BLOB column. I am using Forms 6i REL 2 and Oracle 9i. But I could do it on Oracle 8i with same Forms version.
    Same thing is true for CLOB in 9i.
    Would you please try with this code?
    TABLE
    Create table x
    (Id number,
    Name CLOB,
    Pict BLOB);
    WHEN-BUTTON-PRESSED trigge
    declare
         x varchar2(265);
    begin
         x := get_file_name;
         read_image_file (x, 'GIF', 'picture.pict');
    end;
    Take care,
    Tarek

    Forms 9i and Oracle 9i work fine together for this case.

  • BLOB column not updating

    i have two blob columns in my table say b1 and b2, that are used to store the images. the problem is, when i updates B1 column it works but as i try to update the B2 column only it the error 'ORA-100505 Oracle unable to update record' appears.
    but if i updates both the columns then it accepts the value in B2 as well.
    i am working with orcle 8i 6.1. i had faced this proble earlier agaisnt oracle 8, but as shifted to 8i the problem was solved, but it appeared again.
    the other strange problem is,if the coloumn is blank and i call this any coloumn in report the rports aborts displaying message 'unable to read the image format', how ever it was working very much fine earlier. I tried to recreate the column but no success, i also used EMPTY_BLOB() to initialize the coloum but of no avail.
    Any body could help please?
    thanks in advance

    i have two blob columns in my table say b1 and b2, that are used to store the images. the problem is, when i updates B1 column it works but as i try to update the B2 column only it the error 'ORA-100505 Oracle unable to update record' appears.
    but if i updates both the columns then it accepts the value in B2 as well.
    i am working with orcle 8i 6.1. i had faced this proble earlier agaisnt oracle 8, but as shifted to 8i the problem was solved, but it appeared again.
    the other strange problem is,if the coloumn is blank and i call this any coloumn in report the rports aborts displaying message 'unable to read the image format', how ever it was working very much fine earlier. I tried to recreate the column but no success, i also used EMPTY_BLOB() to initialize the coloum but of no avail.
    Any body could help please?
    thanks in advance

  • Images in Blob Column..

    Hi
    I have a function that retrieves the blob column which has the image data. I cannot view this from Toad and get the value {hugeBLOB} when I query via Toad.
    I used it in a VB.Net app, but I'm unable to reterive the image there also. Can you please suggest how I can retrieve blob column (which has images) into a .jpg format? I need to retreive the images based on the query.
    Thanks for all suggestions.
    ASR

    Hi,
    Your question is not according to Forum. You must post your thread (for immediate response) on Oracle Forum for Dot Net/VB Forum.
    But i'm going to accept your request.
    I've inserted/ saved image in oracle 9i database. And As well i've read/displayed image into Picture Control from Oracle9i database.
    But i've used C# Dot Net (Visual Studio 2005 Professional) as front hand tool.
    Sorry for VB. One thing IMPORTANT:
    I'm going mention code in C# you can Covert into VB Dot Net. Through Online FREE Compiler(www.developerfusion.co.uk/ and click on utilities.)
    --------------------------------Here Below is C# Code ----------------------------------------------------
    Con.Open();
    string myquery = "Select Form_id,Emp_image From Employee where Form_id=2840";
    OracleCommand cmd = new OracleCommand(myquery, con);
    OracleDataReader dr = cmd.ExecuteReader();
    Boolean recordExist = dr.Read();
    if (recordExist)
    //Now displaying Picture.
    MessageBox.Show("Pic is being loaded by C#. Now");
    OracleLob blob = dr.GetOracleLob(1); //Column #, Emp_image
    Byte[] BLOBData = new Byte[blob.Length];
    //Read blob data into byte array
    int i = blob.Read(BLOBData, 0, System.Convert.ToInt32(blob.Length));
    //Get the primitive byte data into in-memory data stream
    MemoryStream stmBLOBData = new MemoryStream(BLOBData);
    //LOADING INTO PICBOX1
    Picbox1.Image = Image.FromStream(stmBLOBData);
    MessageBox.Show("Now i'm reseting it.");
    Picbox1.SizeMode = PictureBoxSizeMode.StretchImage;
    Else
    MessageBox.Show("Reocrd not found against this id.");
    Hopefully it helps you. If it is still difficult to understand don't shy to make query.
    ---

Maybe you are looking for

  • T.c FF7B: planning levels for Logistics

    Hi All, With reference to the Report FF7B and the CM data from Logistics, I've defined the  planning levels for logistics and the others steps under the CASH MANAGEMENT menù of SPRO. But the report FF7A doesn't prodide me the logistic data... are the

  • ERROR: XIAFUSER user is not configured for keystore.....

    Hi all, When I am running the an adpater on XI that uses digital signatures that I have loaded into the TrustedCA's keystore view I get this error in my monitor. ERROR: XIAFUSER user is not configured for keystore TrustedCA's. How do I configure a us

  • Time capsule not working over ethernet cable

    my time capsule is connected to a router (also transmitting a wireless network) using ethernet cable. I can connect to the time capsule using both mac and windows over wireless, and I have internet. However, there's no internet when using ethernet ca

  • Need to reinstall --i think

    I really messed up the webservices and wikis and blogs. My pages are broken and really look like something is missing. I would like to reinstall with my server disk 10.6.3 but when I put it in it spits them out. I have tried to restart and hold the k

  • Loadjava as sysdba

    Hi folks, I'm currently trying to load soap jars into an 9.2.0.5.0 database, following http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/readme.html I've downloaded the Oracle Application server containers OC4J onto my local