BLOB data into varchar2

Hi All,
Can someone please help me in converting BLOB data into varchar2 or long .
we have function which convert long data and return it has varchar . But has part of Apps upgrade the Column has been converted into blob column.
Edited by: user10310673 on Feb 12, 2013 6:56 AM

Hi BluShadow,
This is how i am trying to read the data from BLOB and store it has varchar2 , but my function is not returning any value.. not sure where I am making the mistake ,
but i can see the data in dbms_output.put_line
create or replace function test_alert_msg(v_rowid rowid) return varchar2 is
vblob BLOB;
data_buffer RAW (1);
temp_buffer VARCHAR2(1);
temp_buffer1 varchar2(4000);
amount BINARY_INTEGER := 1;
position INTEGER := 1;
length_count INTEGER;
BEGIN
dbms_output.put_line('Start Time: ' || to_char(sysdate,'DD-MON-RR HH24:MI:SS'));
-- select blob into variable
SELECT GDTXFT
INTO vblob
from jdedta.f00165 m
where rowid = v_rowid;
-- get length of blob
length_count := dbms_lob.getlength(vblob);
dbms_output.put_line('Internal LOB size is: ' || length_count);
WHILE length_count <> 0 LOOP
dbms_lob.read (vblob, amount, position, data_buffer);
temp_buffer := utl_raw.cast_to_varchar2(data_buffer);
temp_buffer1 := temp_buffer1||temp_buffer;
position := position + 1;
length_count := length_count - 1;
data_buffer := null;
END LOOP;
dbms_output.put_line(temp_buffer1);
return(temp_buffer1);
end test_alert_msg;
Output
Start Time: 12-FEB-13 09:21:34
Internal LOB size is: 512
[ O n e W o r l d . A p p l i c a t i o n ]
I s M e n u = 0
A p p l i c a t i o n = P 0 3 B 3 1
F o r m = W 0 3 B 3 1 A
i d F o r m = W 0 3 B 3 1 A
D a t a F o r m a t = 1 | W 0 3 B 3 1 A | 1 | 2 | 3
D a t a = 5 0 6 5 4 3 2 | 3 0 | 0 1 0 0 0

Similar Messages

  • How to load blob data into table

    hi
    i have a table with
    ID     NUMBER     No     -      1
    PARENT_ID     NUMBER     No     -      -
    DOCUMENT     BLOB     Yes     -      -
    NAME     VARCHAR2(40)     Yes     -      -
    MIMETYPE     VARCHAR2(40)     Yes     -      -
    COMMENTS     VARCHAR2(400)     Yes     -      -
    TIMESTAMP_CREATED     TIMESTAMP(6)     Yes     -      -
    CREATED_BY     VARCHAR2(40)     Yes     -      -
    TIMESTAMP_MODIFIED     TIMESTAMP(6)     Yes     -      -
    MODIFIED_BY     CHAR(40)     Yes     -      -
    IS_GROUP     CHAR(1)     No     -      -
    FILE_NAME     VARCHAR2(4000)     Yes     -      -
    as columns. i want to insert blob data into the empty table.i have some fields in the form through which i insert data by hard coding in a process.when i upload a document in the filebrowse type field the mime type is not updating though i have written code in the source value. i removed the database links of the form with the table and that is why i am hard coding to the table thru a process. could u suggest a query where i can insert the blolb data.
    i use the process
    begin
    select max(ID) into aaa from "PSA_KNOWLEDGE_TREE";
    insert into PSA_KNOWLEDGE_TREE values(aaa+1,1,null,:p126_NEW_GROUP,null,:p126_COMMENTS,:P126_TIMESTAMP_CREATED,:P126_CREATED_BY,null,null,'Y',null);

    could u please type the query according to my table and process requirements. i have tried many queries and i have failed to load the blob data. the imetype is not being updated.
    thnx for ur reply

  • Inserting blob data into database

    Hello everybody,
    I need insert blob data into database. that data i need to get from form
    can i use request.getParameter(""); for getting that file.
    Plz help how to get data from form to servlet and through callablestatement i need to insert into database.
    regards,
    Anil

    Hi,
    1) first create a form with file element
    first.jsp
    <form action="GetData" enctype="multipart/form-data" method="post">
    <input type="file" name="datafile" size="40">
    <input type="submit" value="Send">
    <input type="reset" name="Reset" value="Cancel">
    </form>
    GetData.java
    // servlet file
    public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    res.setContentType("text/html");
    PrintWriter out = response.getWriter();
    try {
    System.setProperty( "jdbc.drivers", "com.microsoft.jdbc.sqlserver.SQLServerDriver" );
    Class.forName( "com.microsoft.jdbc.sqlserver.SQLServerDriver" );
    con = DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=JAVATEAM;SelectMethod=cursor;User=sa;Password=urpassword" );
    PreparedStatement pst = con.prepareStatement("insert into uploads(binaryfile) values(?)");
    FileInputStream fis=new FileInputStream(request.getParameter ( "datafile" ) );
    byte[] b= new byte[fis.available()+1];
    fis.read(b);
    pst.setBytes(1,b);
    pst.executeUpdate();
    pst.close();
    con.close();
    catch(SQLException e)
    out.println ( e);
    catch (ClassNotFoundException e)
    out.println( e );
    }Here in doPost(), i create preparedstatement,
    now you to create one procedure for insert
    and by using callable statement you just call that procedure and pass this byte b as arguments,
    now its in your hands
    my idea is over.

  • How to convert BLOB data into string format.

    Hi,
    I have problem while converting blob data into string format.
    for example,
    Select dbms_lob.substr(c.shape.Get_wkb(),4000,1) from geotable c
    will get me the first 4000 byte of BLOB .
    When i using SQL as i did above,the max length is 4000, but i can get 32K using plsql as below:
    declare
    my_var CLOB;
    BEGIN
    for x in (Select X from T)
    loop
    my_var:=dbms_lob.substr(x.X,32767,1)
    end loop
    return my_var;
    I comfortably convert 32k BLOB field to string.
    My problem is how to convert blob to varchar having size more than 32K.
    Please help me to resolve this,
    Thanx in advance for the support,
    Nilesh

    Nilesh,
    . . . .The result of get_wkb() will not be human readable (all values are encoded into some binary format).
    SELECT utl_raw.cast_to_varchar2(tbl.geometry.get_wkt()) from FeatureTable tbl;
    -- resulting string:
        ☺AW(⌂özßHAA
    Å\(÷. . . .You may also want to have a look at { dbms_lob | http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i1015792 } "The DBMS_LOB package provides subprograms to operate on BLOBs, CLOBs, NCLOBs, BFILEs, and temporary LOBs."
    Regards,
    Noel

  • Import BLOB data into Database

    I am trying to import data into a database, via the imp command. However, it creates the rows in the tables, without the original blob data or its somehow lost the internal link to it.
    What could I be doing wrong, and what needs to be done to correct it?

    I think, it was already answered, what the basis problem for such a question is:
    Oracle 10g BLOB data into Postgresql 8.2

  • How to convert blob data into clob using plsql

    hi all,
    I have requirement to convert blob column into clob .
    version details
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE     11.1.0.7.0     Production
    TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    DECLARE
       v_blob      temp.blob_column%TYPE;------this is blob data type column contains  (CSV file which is  inserted  from screens)
       v_clob      CLOB; --i want to copy blob column data into this clob
       v_warning   NUMBER;
    BEGIN
       SELECT blob_column
         INTO v_blob
         FROM temp
        WHERE pk = 75000676;
       DBMS_LOB.converttoclob (dest_lob          => v_clob,
                               src_blob          => v_blob,
                               amount            => DBMS_LOB.lobmaxsize,
                               dest_offset       => 1,
                               src_offset        => 1,
                               blob_csid         => 1, -- what  is the use of this parameter
                               lang_context      => 1,
                               warning           => v_warning
       DBMS_OUTPUT.put_line (v_warning);
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line (SQLCODE);
          DBMS_OUTPUT.put_line (SQLERRM);
    END;I am not getting what is the use of blob_csid , lang_context parameters after going the trough the documentation .
    Any help in this regard would be highly appreciated .......
    Thanks
    Edited by: prakash on Feb 5, 2012 11:41 PM

    Post the 4 digit Oracle version.
    Did you read the Doc for DBMS_LOB.CONVERTTOCLOB? - http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_lob.htm
    The function can convert data from one character set to another. If the source data uses a different character set than the target you need to provide the character set id of the source data.
    The blob_csid parameter is where you would provide the value for the source character set.
    If the source and target use the same character set then just pass zero. Your code is passing a one.
    >
    General Notes
    You must specify the character set of the source data in the blob_csid parameter. You can pass a zero value for blob_csid. When you do so, the database assumes that the BLOB contains character data in the same character set as the destination CLOB.
    >
    Same for 'lang_context' - your code is using 1; just use 0. It is an IN OUT
    >
    lang_context
    (IN) Language context, such as shift status, for the current conversion.
    (OUT) The language context at the time when the current conversion is done.
    This information is returned so you can use it for subsequent conversions without losing or misinterpreting any source data. For the very first conversion, or if do not care, use the default value of zero.

  • Oracle 10g BLOB data into Postgresql 8.2

    Any Docs on Oracle 10g BLOB importing into Postgresql 8.2.
    Thanks in Advance.
    Harish Kumar R

    Postgresql is not an Oracle product. Perhaps you should address your question to the people that make it.

  • Unable to insert large blob data into DB

    Hi,
    I have written a piece of code which serializes a java object and writes it into a blob in DB.
    It works pretty fine for small objects of around 3 to 4 KB size, but I start getting trouble with larger objects.
    Here's my piece of code -
    private final static String QUERY_INSERT_AUDIT_DATA = "INSERT INTO " +
    "KAAS_AUDIT_DATA(object_id, object_type_cd, create_by, summary_data) VALUES (?, ?, ?, ?)";
    byte [] byteArray;
    bos = new ByteArrayOutputStream();
    oos = new ObjectOutputStream(bos);
    oos.writeObject(summaryData);
    oos.flush();
    oos.close();
    byteArray = bos.toByteArray();
    bos.close();
    ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
    BufferedInputStream buffInputSteam = new BufferedInputStream(bais);
    trace("addAuditSummary() : byteArray " + byteArray.length);
    trace("addAuditSummary() : buffInputSteam.available " + buffInputSteam.available());
    trace("addAuditSummary() : Calling Query to populating data");
    statement = conn.prepareStatement(QUERY_INSERT_AUDIT_DATA);
    statement.setString(1, objectId.toUpperCase());
    statement.setInt(2, objectType);
    statement.setString(3, createdBy);
    statement.setBinaryStream(4, buffInputSteam, buffInputSteam.available());
    statement.executeUpdate();
    statement.close();
    Basically, I am converting the object to BufferedInputStream to sent it to the BLOB(summary_data).
    The error I get is -
    ][30 Nov 2007 10:38:08] [ERROR] [com.hns.iag.kaas.util.debug.DebugDAO] addAuditSummary() : SQL exception occured while adding audit summary data for Object: BUSINESS_SO_BASE_DEAL
    ]java.sql.SQLException: Io exception: Connection reset by peer.
    at oracle.jdbc.dbaccess.DBError.throwSqlException(Ljava/lang/String;Ljava/lang/String;I)V(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(ILjava/lang/Object;)V(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(Ljava/io/IOException;)V(DBError.java:334)
    at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(Ljava/io/IOException;)V(TTC7Protocol.java:3675)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(BBI[B[Loracle/jdbc/dbaccess/DBType;[Loracle/jdbc/dbaccess/DBData;I[Loracle/jdbc/dbaccess/DBType;[Loracle/jdbc/dbaccess/DBData;I)V(Optimized Method)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(Loracle/jdbc/dbaccess/DBStatement;B[BLoracle/jdbc/dbaccess/DBDataSet;ILoracle/jdbc/dbaccess/DBDataSet;I)I(TTC7Protocol.java:1141)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout()V(Optimized Method)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate()I(Optimized Method)
    at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate()I(PreparedStatement.java:94)
    at com.hns.iag.kaas.util.debug.DebugDAO.addAuditSummary(Ljava/lang/String;ILjava/lang/Object;Ljava/lang/String;)V(DebugDAO.java:794)
    at com.hns.iag.kaas.servlets.sdm.action.SummaryAction.perform(Lcom/hns/iag/kaas/servlets/sdm/core/Event;Lcom/hns/iag/kaas/servlets/sdm/core/UserContext;)Ljava/lang/String;(SummaryAction.java:246)
    at com.hns.iag.kaas.servlets.sdm.SDMControllerServlet.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(SDMControllerServlet.java:213)
    at com.hns.iag.kaas.servlets.sdm.SDMControllerServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(SDMControllerServlet.java:128)
    at javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(ServletStubImpl.java:971)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl;)V(ServletStubImpl.java:402)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(WebAppServletContext.java:6354)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(SecurityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl;)V(WebAppServletContext.java:3635)
    at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread;)V(ServletRequestImpl.java:2585)
    at weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest;)V(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:170)
    at java.lang.Thread.startThreadFromVM(Ljava/lang/Thread;)V(Unknown Source)
    I would really appreciate any help.
    Thanks
    Saurabh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

    I would say, most likele BufferedInputStream.available() returns an incorrect length. available() does not return the length of the InputStream. See the javadocs for the details
    Additionally: it doesn't make sense at all to wrap the ByteArrayInputStream with a BufferedInputStream, the array is in memory already, so there is no need to buffer the read access to it (you are simply adding more overhead).
    Remove the BufferedInputStream (passing the bais directly to the setBinaryStream() method) and use byteArray.length to indicate the length of the data

  • Problems writing BLOB data into O8i (ADO and AppendChunk)

    We have a table where you want to store bianry data (BLOBs). I
    have used the LONG RAW datatype to store this information. Here
    is the code for the table:
    CREATE TABLE "CONTENTBLOBTABLE" (
    DIGEST NVARCHAR2(40) NOT NULL,
    BLOB LONG RAW,
    CHECK (DIGEST IS NOT NULL),
    PRIMARY KEY (DIGEST)
    Then we try to update this table with ADO 2.6 on a Windows 200
    machine with Oracle ODBC driver. Here is the relevant code
    snippet:
    // set the value of the field
    pRs->AddNew();
    pRs->Fields->GetItem("DIGEST")->PutValue(strDigest);
    pRs->Fields->GetItem("BLOB")->AppendChunk(varBLOB);
    if(!pRs->Update())
    C_LOG_CRITICAL(L"CC_CS_DAL::WriteBLOB - pRs->Update failed");
    *error = C_CS_CBT_ERROR;
    pRs->CancelUpdate();
    pRs->Close();
    m_pConn->Close();
    m_spObjectContext->SetAbort();
    return S_FALSE;
    OK, NO error occurs: no exception, HRESULT return values are all
    OK, method completes.
    BUT: there is no data in the table!?!?! When querying the exact
    same table we get an empty result!
    Any ideas please?
    Thanks,
    Christian

    Did you even get a reply to this message?

  • How to Get Blob data(In String Form) using OCCI

    Hello frnds,
    I am new to OCCI,so i hvnt that much of master in that side.
    I have one problem while handling BLOb data.
    How to convert binary form of SDO_GEOMETRY data into string format. I am able to convert data by using PLSQL block,but its take so much time to execute.So performance is the main issue.So if there is any API in OCCI which convert directly blob data into string format.
    Thanx in advance for your support,
    Nilesh.

    Have you tried reading "http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28390/lobs.htm#BABDEGJD" ? This explains how you can read from BLOBs into a C vector (or C++ vector of chars).

  • Attaching BLOB Data using BPEL Process

    Hi,
    I need to upload resume(BLOB Data) into irc_documents.binary_doc(binay_doc is BOLB Data type) by using BPEL Process.
    Could you please let me know the steps to be followed to upload the Binary Document.
    My Contact Mail Id:[email protected]
    Regards,
    Praveen

    by use of for example a opaque schema you should be able to get the data in your process.
    http://soastuff.wordpress.com/2007/06/06/handling-opaque-datatypes-in-bpelesb/
    this might help.
    do you want to send the binary data thrue the whole bpel process, or do you want to get in somewhere in the middle of the process ?

  • How can I copy BLOB data between records

    I have a record that contains a BLOB field.
    I want to create a new record from this record, obviously changing other fields so there is not
    a duplicate key, etc. I do NOT want to have to
    extract the BLOB data into a file then re-insert
    it into the new record for obvious performance
    reasons.
    How can I copy the BLOB data from the original record to the record I am creating?

    Hi Bradley,
    Try to create a statement like: insert into myTable values("id","name",(select blob_value from mytable where id="theIdWithTheblob"));
    Hope this helps.
    - Kalle

  • How to insert data into the BLOB column

    Hi All,
    Can anyone help me to insert data into the BLOB data type column?
    The table structure is
    CREATE TABLE XXATFL_DM_FORCAST_STG
    TASK_ID NUMBER,
    USER_ID NUMBER,
    CREATED_BY NUMBER(15),
    CREATION_DATE DATE,
    LAST_UPDATED_BY NUMBER(15),
    LAST_UPDATE_DATE DATE,
    LAST_UPDATE_LOGIN NUMBER(15),
    RECORD_STATUS VARCHAR2(1 BYTE),
    ERROR_MESSAGE VARCHAR2(4000 BYTE),
    DATA_FILE BLOB
    I want to insert data in the DATA_FILE column. and this insert statement will in inside a procedure.
    Please help me as soon as possible as this is very urgent for me
    Thanks & Regards,
    Chandan

    i tried like this
    sql> insert into tbl values(1, utl_raw.cast_to_raw('D:\pictures\pic2.bmp'));
    1 record created.
    sql>select * from tbl;
    sp2-0678:Column or attribute type can not be displayed by SQL*PLUS
    sql>
    is this saving only path or bmp file on that path?
    if it is saving bmp file, in which format and how can we retrive it?
    Edited by: user8967883 on Mar 31, 2010 12:57 PM

  • Error reading data from CLOB column into VARCHAR2 variable

    Hi all,
    Am hitting an issue retrieving data > 8K (minus 1) stored in a CLOB column into a VARCHAR2 variable in PL/SQL...
    The "problem to be solved" here is storing DDL, in this case a "CREATE VIEW" statement, that is longer than 8K for later retrieval (and execution) using dynamic SQL. Given that the EXECUTE IMMEDIATE statement can take a VARCHAR2 variable (up to 32K(-1)), this should suffice for our needs, however, it seems that somewhere in the process of converting this VARCHAR2 text to a CLOB for storage, and then retrieving the CLOB and attempting to put it back into a VARCHAR2 variable, it is throwing a standard ORA-06502 exception ("PL/SQL: numeric or value error"). Consider the following code:
    set serveroutput on
    drop table test1;
    create table test1(col1 CLOB);
    declare
    cursor c1 is select col1 from test1;
    myvar VARCHAR2(32000);
    begin
    myvar := '';
    for i in 1..8192 loop
    myvar := myvar || 'a';
    end loop;
    INSERT INTO test1 (col1) VALUES (myvar);
    for arec in c1 loop
    begin
    myvar := arec.col1;
    dbms_output.put_line('Read data of length ' || length(myvar));
    exception when others then
    dbms_output.put_line('Error reading data: ' || sqlerrm);
    end;
    end loop;
    end;
    If you change the loop upper bound to 8191, all works fine. I'm guessing this might have something to do with the database character set -- we've recently converted our databases over to UTF-8, for Internationalizion support, and that seems to have changed underlying assumptions regarding character processing...?
    As far as the dynamic SQL issue goes, we can probably use the DBMS_SQL interface instead, with it's EXECUTE procedure that takes a PL/SQL array of varchar2(32K) - the only issue there is reading the data from the CLOB column, and then breaking that data into an array but that doesn't seem insurmountable. But this same basic issue (when a 9K text block, let's say, turns into a >32K block after being CLOBberred) seems to comes up in other text-processing situations also, so any ideas for how to resolve would be much appreciated.
    Thanks for any tips/hints/ideas...
    Jim

    For those curious about this, here's the word from Oracle support (courtesy of Metalinks):
    RESEARCH
    ========
    Test the issue for different DB version and different characterset.
    --Testing the following PL/SQL blocks by using direct assignment method(myvar := arec.col1;) on
    different database version and different characterset.
    SQL>create table test1(col1 CLOB);
    --Inserting four CLOB data into test1.
    declare
    myvar VARCHAR2(32767);
    begin
    myvar := RPAD('a',4000);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('a',8191);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('b',8192);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('c',32767);
    INSERT INTO test1 (col1) VALUES (myvar);
    commit;
    end;
    --Testing the direct assignment method.
    declare
    cursor c1 is select col1, length(col1) len1 from test1;
    myvar VARCHAR2(32767);
    begin
    for arec in c1 loop
    myvar := arec.col1;
    --DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar);
    dbms_output.put_line('Read data of length: ' || length(myvar));
    end loop;
    end;
    The following are the summary of the test results:
    ===================================
    1. If the database characterset is WE8ISO8859P1, then the above direct assignment
    method(myvar := arec.col1;) works for database version 9i/10g/11g without any
    errors.
    2. If the database characterset is UTF8 or AL32UTF8, then the above direct assignment method(myvar := arec.col1;) will generate the "ORA-06502:
    PL/SQL: numeric or value error" when the length of the CLOB data is greater
    than 8191(=8K-1). The same error can be reproduced across all database versions
    9i/10g/11g.
    3. Using DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar) method to read CLOB data into a VARCHAR2 variable works for both WE8ISO8859P1 and UTF8
    characterset and for all database versions.
    So - it seems as I'd surmised, UTF8 changes the way VARCHAR2 and CLOB data is handled. Not too surprising, I suppose - may you all be lucky enough to be able to stay away from this sort of issue. But - the DBMS_LOB.READ workaround is certainly sufficient for the text processing situations we find ourselves in currently.
    Cheers,
    Jim C.

  • How to insert  data into BLOB column  using sql

    Hi all,
    How to insert data into BLOB column directly using sql .
    create  table temp
      a blob,
      b clob);
    SQL> /
    Insert into temp  values ('32aasdasdsdasdasd4e32','adsfbsdkjf') ;
    ERROR at line 1:
    ORA-01465: invalid hex number
    Please help in this.Thanks,
    P Prakash

    see this
    How to store PDF file in BLOB column without using indirect datastore

Maybe you are looking for

  • Report for production order with actual and target cost for each

    Hi Is there any report that gives me the list of all production orders in a month with its respective actual and target costs? I can use COOIS to get a list of production orders, then double click on the prod order, then click on goto and then to cos

  • Split Invoice in PO

    There is a split invoice indicator in the condition details in the PO Conditions tab. Does anyone know what this is used for?

  • Mac Book Pro Kernel Panic

    Hi all I am new to the discussion board as a poster (though I have used the board much during my time as a MBP owner). I have recently (past 2 weeks) started having fairly regular kernel panics. I have my MBP since August 2009 and have upgraded the r

  • HELP I've lost ALL my photos!

    Please can somebody help me. I don't know what's happened but I opened iPhoto today while I had some other photo files on the desktop and when iPhoto opened it didn't have a single photo in it. The file names are still there but there is no memory be

  • Message level security: difference digital signature and certificate

    Hi everybody, could anybody please explain the difference between <b>digital signature</b> and <b>certificate</b>? Thans Regards Mario