CLOB field conversion

Hello,
I'm doing an Access 97 -> Oracle 8.1.6 migration using OMWB 1.2.5.0.0.
After having done a complete successful migration including
modification of the source database, we notice that the Memo to CLOB
conversion apparently was not completely successful: special
characters such as the German umlauts are not displayed correctly, not
within Access nor in plain SQL queries.
"Normal" fields do not show that effect, but have been converted
correctly.
Is this a known issue?
Any hint appreciated.
Regards, Thomas Meyer
null

Hello again Thomas,
I hate to be harbinger of bad news but there is no official workaround available. My only suggestion would be to avoid the CLOBS and use varchar but this in itself causes problems if the CLOB data is too large to for the varchar type to hold.
As for estimating the timescale for the next release of the Oracle server.. sorry but yet again I cannot help there.
As this is an RDBMS issue, contact Oracle support and have the bug's priority escalated.
Not much help really. I do apologise.
Regards
Brian.

Similar Messages

  • Inserting to a CLOB field in Oracle 8i  Database

    Hi All,
    I am trying to insert a value to a CLOB field in Oracle 8i DB.
    The value gets inserted when the size is less (Up to around 80 Bytes).
    When the size becomes larger the insertion does not take place but no exception is thrown.
    Please see below the code I have written.
    PreparedStatement preparedStatement = null;
              try {
                   connection = getConnection(MMAKeys.WMDS_DATASOURCE);
                   String query = "UPDATE s_mmhp_batch SET MMHP_REPORT_CLOB=(?) WHERE MMHP_BATCH_ID=(?) AND MMHP_USER_ID=(?) AND MMHP_MEMBER_KEY=(?)";
              preparedStatement=connection.prepareStatement(query);
              Reader r = new StringReader(clobReport);
              preparedStatement.setCharacterStream(1, r, clobReport.length());
              oracle.sql.CLOB newClob = oracle.sql.CLOB.createTemporary(connection , false, oracle.sql.CLOB.DURATION_CALL);
              newClob.putString(1,clobReport);
              preparedStatement.setClob(1,newClob);
              preparedStatement.setInt(2,batchId);
              preparedStatement.setString(3,userId);
              preparedStatement.setString(4,memberKey);
              preparedStatement.executeUpdate();
              System.out.println("inside the write to Batch method after executing the query");
              } catch (SQLException exception) {
                   throw new DAOException(
                        "MREDMMSDAO -> writeToTable():SQLException"
                             + exception.getMessage());
              } catch (Exception exception) {
                   throw new DAOException(
                        "MREDMMSDAO -> writeToTable():Exception"
                             + exception.getMessage());
              } finally {
                   closeStatement(preparedStatement);
                   closeConnection(connection);
    I came to know that this method is not supported in Oracle 8i.
    I tried to create an empty CLOB and call the putValue() method.
    But Then, I got an exception stating that the method is not supported.
    Is there any other way to insert a CLOB value to Oracle 8i?
    Please help.
    Thanks in advance,
    Neelambary

    And cursor.callproc('insert_clob_proc', (clob,))
    doesn't work for you?
    PrzemekYes - I should have been more clear in my original post. The callproc function works until we have a value which is over 32K. At values over 32K, we get an error message "ORA-01460: unimplemented or unreasonable conversion requested". I believe this is because we are sending the value as a string and so we would need to figure out how to send as a CLOB in cx_Oracle? Here is some code to use to test if interested...
    Oracle (Oracle Database 10g Release 10.1.0.4.0 - Production):
    CREATE TABLE clob_test (CLOB_FIELD CLOB);
    CREATE OR REPLACE PROCEDURE ins_clob_test (v_clob_field IN CLOB)
    AS
    BEGIN
    INSERT INTO clob_test (clob_field) VALUES (v_clob_field);
    END ins_clob_test;
    Python (2.5):
    conn = cx_Oracle.connect(xhash['oraclelogin'])
    cursor = conn.cursor()
    clob_var = 'Some test data' * 10000
    cursor.callproc('ins_clob_test',(clob_var,))
    conn.commit()
    cursor.close()
    conn.close()
    I should also mention that I am the Oracle developer and not the Python programmer - my knowledge of Python is very limited. I would like the Python programmers to use the procedures (packages) I have created to do their inserts but this situation has caused them to put the SQL directly in their code.
    Thanks again for any assistance you can provide.
    Jason

  • Inserting to a clob field using cx_Oracle via a stored procedure

    Hello,
    Does anyone have experience using cx_Oracle to call a stored procedure which inserts to a clob field? I have found examples of doing this via straight SQL but I was hoping it was possible to do this via a stored procedure call. Thanks for any help you can provide.
    Jason

    And cursor.callproc('insert_clob_proc', (clob,))
    doesn't work for you?
    PrzemekYes - I should have been more clear in my original post. The callproc function works until we have a value which is over 32K. At values over 32K, we get an error message "ORA-01460: unimplemented or unreasonable conversion requested". I believe this is because we are sending the value as a string and so we would need to figure out how to send as a CLOB in cx_Oracle? Here is some code to use to test if interested...
    Oracle (Oracle Database 10g Release 10.1.0.4.0 - Production):
    CREATE TABLE clob_test (CLOB_FIELD CLOB);
    CREATE OR REPLACE PROCEDURE ins_clob_test (v_clob_field IN CLOB)
    AS
    BEGIN
    INSERT INTO clob_test (clob_field) VALUES (v_clob_field);
    END ins_clob_test;
    Python (2.5):
    conn = cx_Oracle.connect(xhash['oraclelogin'])
    cursor = conn.cursor()
    clob_var = 'Some test data' * 10000
    cursor.callproc('ins_clob_test',(clob_var,))
    conn.commit()
    cursor.close()
    conn.close()
    I should also mention that I am the Oracle developer and not the Python programmer - my knowledge of Python is very limited. I would like the Python programmers to use the procedures (packages) I have created to do their inserts but this situation has caused them to put the SQL directly in their code.
    Thanks again for any assistance you can provide.
    Jason

  • Query filter using a converted CLOB field

    Hi,
    I need to filter a query by a CLOB field on the database. When I just select the filed, the query runs successfully. But, when I try to filter by this CLOB field, converting it to Date or Char, I got an error message. I detail it step by step below.
    Please, can somebody help me to figure out what is happening with this filter?
    DB Version: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
    Step 1- The Query works fine
    SELECT TO_CHAR( CLOB_FIELD ) FIELD_CLOB_TO_CHAR1,
    TO_CHAR(TO_DATE(TO_CHAR( CLOB_FIELD ), 'mm/dd/yyyy', 'NLS_DATE_LANGUAGE=PORTUGUESE'), 'dd/mm/yyyy') FIELD_CLOB_TO_CHAR2,
    TO_CHAR(sysdate, 'dd/mm/yyyy', 'NLS_DATE_LANGUAGE=PORTUGUESE') SYSDATE_DATE_TO_CHAR,
    TO_DATE(TO_CHAR( CLOB_FIELD ), 'mm/dd/yyyy') FIELD_CLOB_TO_DATE1,
    TO_DATE( CLOB_FIELD, 'mm/dd/yyyy') FIELD_CLOB_TO_DATE2
    FROM MY_TABLE
    FIELD_CLOB_TO_CHAR1: 08/10/2012     
    FIELD_CLOB_TO_CHAR2: 10/08/2012
    SYSDATE_DATE_TO_CHAR: 23/07/2012
    FIELD_CLOB_TO_DATE1: 10/08/2012
    FIELD_CLOB_TO_DATE2: 10/08/2012
    Step 2- Adding one of the filters below. I got the same error message for them:
    and TO_DATE( CLOB_FIELD, 'mm/dd/yyyy') = to_date(to_char(sysdate,'mm/dd/yyyy'), 'mm/dd/yyyy');
    and TO_CHAR(TO_DATE(TO_CHAR( CLOB_FIELD ), 'mm/dd/yyyy', 'NLS_DATE_LANGUAGE=PORTUGUESE'), 'dd/mm/yyyy') = to_char(sysdate,'mm/dd/yyyy');
    Report Error:
    SQL Error: ORA-01858: a non-numeric character was found where a numeric was expected
    01858. 00000 - "a non-numeric character was found where a numeric was expected"
    *Cause:    The input data to be converted using a date format model was
    incorrect. The input data did not contain a number where a number was
    required by the format model.
    *Action:   Fix the input data or the date format model to make sure the
    elements match in number and type. Then retry the operation.
    Regards,

    user634269 wrote:
    Keith, thanks again.
    It works fine. I just changed the exception return to show more clearly in which record the problem is. I did:
    when others
    then
    v_returndate := SYSDATE+3000;
    But, I still have some doubts and I believe they are related:
    1- The dates on CLOB_FIELD are recorded in "mm/dd/yyyy" format. So, when something like 08/09/2011 is found, the things work fine. But, when something like 12/20/2011 is found, I got the problem. I always believed that formatting dates would solve this kind of situation.
    2- The function you suggested only converts a varchar parameter into a date value. (simple and clever). I changed the filter from "= sysdate" to "<= sysdate" and got 5 records only. It worked fine. But, considering that the function only applies TO_DATE() on a varchar parameter, why can I do this:
    MY_TO_DATE( CLOB_FIELD, 'mm/dd/yyyy') <= to_date(to_char(sysdate,'mm/dd/yyyy'), 'mm/dd/yyyy');
    and cannot one of these?
    TO_DATE( CLOB_FIELD, 'mm/dd/yyyy') <= to_date(to_char(sysdate,'mm/dd/yyyy'), 'mm/dd/yyyy');
    TO_DATE( to_char(CLOB_FIELD), 'mm/dd/yyyy') <= to_date(to_char(sysdate,'mm/dd/yyyy'), 'mm/dd/yyyy')
    3- The first function parameter is VARCHAR, but I'm sending the CLOB_FIELD without any conversion. Does Oracle perform an implicit data conversion?
    I really would like to understand how Oracle is working with all these things.
    Regards.
    >Keith, thanks again.
    It works fine. I just changed the exception return to show more clearly in which record the problem is. I did:
    when others
    then
    v_returndate := SYSDATE+3000;
    But, I still have some doubts and I believe they are related:
    1- The dates on CLOB_FIELD are recorded in "mm/dd/yyyy" format. So, when something like 08/09/2011 is found, the things work fine. But, when something like 12/20/2011 is found, I got the problem. I always believed that formatting dates would solve this kind of situation.
    You must use the format mask which matches the format of data. Your date data is in the format mm/dd/yyyy and so you need to provide that format mask.
    to_date('12/20/2011','mm/dd/yyyy') will cause the data to be correctly converted to a date
    2- The function you suggested only converts a varchar parameter into a date value. (simple and clever). I changed the filter from "= sysdate" to "<= sysdate" and got 5 records only. It worked fine. But, considering that the function only applies TO_DATE() on a varchar parameter, why can I do this:
    MY_TO_DATE( CLOB_FIELD, 'mm/dd/yyyy') <= to_date(to_char(sysdate,'mm/dd/yyyy'), 'mm/dd/yyyy');
    This works because although the implicit conversion fails,  my function suppresses any error that is raised using the following exception block
    exception
    when others
    then
        null;
    and cannot one of these?
    TO_DATE( CLOB_FIELD, 'mm/dd/yyyy') <= to_date(to_char(sysdate,'mm/dd/yyyy'), 'mm/dd/yyyy');
    TO_DATE( to_char(CLOB_FIELD), 'mm/dd/yyyy') <= to_date(to_char(sysdate,'mm/dd/yyyy'), 'mm/dd/yyyy')
    These do not work , because you are using the inbuilt functions which are raising errors.
    if you change
    when others
    then
    null; to
    when others
    then
    raise; my function will no longer work. You should read the FAQ on exception handling. When others then null is used to suppress any error that is raised. This is not normally good practice.
    3- The first function parameter is VARCHAR, but I'm sending the CLOB_FIELD without any conversion. Does Oracle perform an implicit data conversion?
    Yes, oracle will try to do an implicit conversion whenever no  explicit conversion is specified.  You should always try to use explicit conversions rather than rely on implicit conversions.
    >
    I really would like to understand how Oracle is working with all these things.
    A good start would be to read and understand the frequently asked questions provided by Blueshadow.
    This is also a bad construct:
    <= to_date(to_char(sysdate,'mm/dd/yyyy'), 'mm/dd/yyyy')
    all you need here is sysdate. If you want to remove the time element, you can just use trunc(sysdate)

  • Problems in using CLOB field

    I am trying to use a clob field in a select statment and I am getting "Ora-00932: inconsistent datatypes" error.
    I am using Oracle 817.
    Any idea or fix?

    The reason your statement throws an error is because
    of the DISTINCT, not because of joins. Oracle can
    only do distinct on basic data types (CHAR, VARCHAR2,
    NUMBER and DATE). It tries to do an implicit
    conversion from CLOB to VARCHAR to do the DISTINCT.
    CLOBS over 4000 characters cannot be converted to
    VARCHAR2. So, even without any joins ...Agreed ... but my DISTINCT wasn't on the CLOB. It was on a VARCHAR2. Let me restate (hopefully a little more clearly) what I was referring too to see if you can think of any ways to do what I'm trying to do. The first example I know will work provided the CLOB doesn't contain over 4000 characters. The 2nd example (the same as the example originally mentioned) will not work. I'm wanting to do something like the 2nd example but with the same results as the first.
    EX #1: (will work)
    SELECT
    DISTINCT table1.varcharField1,
    table1.varcharField2,
    table2.varcharField3,
    DBMS_LOB.SUBSTR(table1.CLOBField4,DBMS_LOB.GETLENGTH(table1.CLOBField4)),
    table3.varcharField5
    FROM
    table1,
    table2,
    table3
    WHERE
    table1.varcharField1 = table2.varcharField1
    AND table1.varcharField1 = table3.varcharField1
    AND table1.varcharField2 = 'XYZ'
    EX #2: (will not work)
    SELECT
    DISTINCT table1.varcharField1,
    table1.varcharField2,
    table2.varcharField3,
    table1.CLOBField4,
    table3.varcharField5
    FROM
    table1,
    table2,
    table3
    WHERE
    table1.varcharField1 = table2.varcharField1
    AND table1.varcharField1 = table3.varcharField1
    AND table1.varcharField2 = 'XYZ'
    This is SQL for a report so the entire contents of the CLOB field are required. (In actuality, the dbase column should have originally been defined as a VARCHAR2. Since we already have other programs in place that hit these table fields, we can't arbitrarily go back and change it.) If we leave the first SQL example in place, it'll work but it'll cause the SQL to crash if the data in that field ever exceeds 4000 characters. That's why we're trying to do away with the DBMS_LOB.SUBSTR() method. BUT if we don't interpret the CLOB in some other fashion, it'll throw the ORA-00932 error because of a data inconsistencies.
    Any advice you could offer would certainly be appreciated.
    BJ

  • Getting all occurrences from a clob field

    I created a clob field to store an XML document. I have tried the SUBSTR, INSTR, REGEXP_SUBSTR, DBMS_LOB.INSTR functions to extract all occurrence of the XML tab <systemLink>.
    I just get 1 occurrence of the XML tag.
    Has anyone done this before.
    Thanks.

    All occurrences in a single row
    select extract(xmltype(your_clob_field),'//systemLink')
    from dualOr all occurrences in distinct rows
    select *
    from TABLE (XMLSEQUENCE (EXTRACT (XMLTYPE (your_clob_field), '//systemLink'))) ; Max
    http://oracleitalia.wordpress.com

  • Multiple clob fields in a single table

    Are there any known performance issues associated with having 4 CLOB fields in a single table... the table as such will be relatively small.. like 100 MB... with most rows being << 50k.

    Not really. If you need 4 CLOB columns and it makes sense to have alll the columns in a single table, go for it.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Export XML data from a CLOB field using sql developer

    I have a table that contains a CLOB field, each record is a complete XML in itself. After running the select query i am exporting this data by right clicking on the answer set, while the export completes the data for each record gets truncated.
    When i chose to save the export in loader format i get the complete records but now there are n files created for n records exported.
    Is there a way i can get alll the records in a single file wirthout any truncation.
    Thanks in advance!

    You might try delimited format or csv, with no enclosures if desired.

  • Urgent: How to set a default value to CLOB field?

    Hi All,
    As per the requirements we have to populate the CLOB field in a template with default value with some template similar to a letter issued to clients in bank.
    So, every time when I insert a record in that table this CLOB field should have that letter template populated by default and user will modify that if required from GUI.
    How can I populate that CLOB field by default?
    Thanks!

    Something like this?
    ME_XE?
    create table test_clob
      pk_value number primary key,
      one_clob clob   default rpad('something', 32000, '*')
    insert into test_clob (pk_value) values (1);
    select * from test_clob;
    Table created.
    Elapsed: 00:00:00.13
    ME_XE?ME_XE?
    1 row created.
    Elapsed: 00:00:00.09
    ME_XE?ME_XE?
              PK_VALUE ONE_CLOB
                     1 something***********************************************************************
    1 row selected.
    Elapsed: 00:00:02.65
    ME_XE?ME_XE?
    ME_XE?ME_XE?select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    5 rows selected.
    Elapsed: 00:00:00.18
    ME_XE?

  • Need help for SQL SELECT query to fetch XML records from Oracle tables having CLOB field

    Hello,
    I have a scenario wherein i need to fetch records from several oracle tables having CLOB fields(which is holding XML) and then merge them logically to form a hierarchy XML. All these tables are related with PK-FK relationship. This XML hierarchy is having 'OP' as top-most root node and ‘DE’ as it’s bottom-most node with One-To-Many relationship. Hence, Each OP can have multiple GM, Each GM can have multiple DM and so on.
    Table structures are mentioned below:
    OP:
    Name                             Null                    Type        
    OP_NBR                    NOT NULL      NUMBER(4)    (Primary Key)
    OP_DESC                                        VARCHAR2(50)
    OP_PAYLOD_XML                           CLOB       
    GM:
    Name                          Null                   Type        
    GM_NBR                  NOT NULL       NUMBER(4)    (Primary Key)
    GM_DESC                                       VARCHAR2(40)
    OP_NBR               NOT NULL          NUMBER(4)    (Foreign Key)
    GM_PAYLOD_XML                          CLOB   
    DM:
    Name                          Null                    Type        
    DM_NBR                  NOT NULL         NUMBER(4)    (Primary Key)
    DM_DESC                                         VARCHAR2(40)
    GM_NBR                  NOT NULL         NUMBER(4)    (Foreign Key)
    DM_PAYLOD_XML                            CLOB       
    DE:
    Name                          Null                    Type        
    DE_NBR                     NOT NULL           NUMBER(4)    (Primary Key)
    DE_DESC                   NOT NULL           VARCHAR2(40)
    DM_NBR                    NOT NULL           NUMBER(4)    (Foreign Key)
    DE_PAYLOD_XML                                CLOB    
    +++++++++++++++++++++++++++++++++++++++++++++++++++++
    SELECT
    j.op_nbr||'||'||j.op_desc||'||'||j.op_paylod_xml AS op_paylod_xml,
    i.gm_nbr||'||'||i.gm_desc||'||'||i.gm_paylod_xml AS gm_paylod_xml,
    h.dm_nbr||'||'||h.dm_desc||'||'||h.dm_paylod_xml AS dm_paylod_xml,
    g.de_nbr||'||'||g.de_desc||'||'||g.de_paylod_xml AS de_paylod_xml,
    FROM
    DE g, DM h, GM i, OP j
    WHERE
    h.dm_nbr = g.dm_nbr(+) and
    i.gm_nbr = h.gm_nbr(+) and
    j.op_nbr = i.op_nbr(+)
    +++++++++++++++++++++++++++++++++++++++++++++++++++++
    I am using above SQL select statement for fetching the XML records and this gives me all related xmls for each entity in a single record(OP, GM, DM. DE). Output of this SQL query is as below:
    Current O/P:
    <resultSet>
         <Record1>
              <OP_PAYLOD_XML1>
              <GM_PAYLOD_XML1>
              <DM_PAYLOD_XML1>
              <DE_PAYLOD_XML1>
         </Record1>
         <Record2>
              <OP_PAYLOD_XML2>
              <GM_PAYLOD_XML2>
              <DM_PAYLOD_XML2>
              <DE_PAYLOD_XML2>
         </Record2>
         <RecordN>
              <OP_PAYLOD_XMLN>
              <GM_PAYLOD_XMLN>
              <DM_PAYLOD_XMLN>
              <DE_PAYLOD_XMLN>
         </RecordN>
    </resultSet>
    Now i want to change my SQL query so that i get following output structure:
    <resultSet>
         <Record>
              <OP_PAYLOD_XML1>
              <GM_PAYLOD_XML1>
              <GM_PAYLOD_XML2> .......
              <GM_PAYLOD_XMLN>
              <DM_PAYLOD_XML1>
              <DM_PAYLOD_XML2> .......
              <DM_PAYLOD_XMLN>
              <DE_PAYLOD_XML1>
              <DE_PAYLOD_XML2> .......
              <DE_PAYLOD_XMLN>
         </Record>
         <Record>
              <OP_PAYLOD_XML2>
              <GM_PAYLOD_XML1'>
              <GM_PAYLOD_XML2'> .......
              <GM_PAYLOD_XMLN'>
              <DM_PAYLOD_XML1'>
              <DM_PAYLOD_XML2'> .......
              <DM_PAYLOD_XMLN'>
              <DE_PAYLOD_XML1'>
              <DE_PAYLOD_XML2'> .......
              <DE_PAYLOD_XMLN'>
         </Record>
    <resultSet>
    Appreciate your help in this regard!

    Hi,
    A few questions :
    How's your first query supposed to give you an XML output like you show ?
    Is there something you're not telling us?
    What's the content of, for example, <OP_PAYLOD_XML1> ?
    I don't think it's a good idea to embed the node level in the tag name, it would make much sense to expose that as an attribute.
    What's the db version BTW?

  • Make a clob field as an editable column in a report

    Hello,
    I have a CLOB field column in my report and want to make this as an editable item. Can anyone please tell me what would be the best approach to deal with these kind of issue.
    Thanks,
    Orton

    Dan McGhan wrote:
    There is no "out of the box" solution for this. You'd have to do a bit of work. However, before we go down that road, I'm curious as to why you'd want to put a password field in a tabular form.
    It's a multi row insert/update/delete (tabular) form, and one of the columns represents a password.
    One row represents "an application". The column represents the application password.
    I actually have two of them (columns) + a process that verifies that the same value was entered in both.
    I'm suprised that this is not out-of-the box possible...
    It would be a very easy to just support the 'password field' type in the dropdown list that I have now used to make it a simple text field. No?
    Appreciate any assistance...
    Edited by: Toon Koppelaars on Jul 14, 2010 1:20 PM

  • How to store the contents of a text file directly in to a clob field

    Hi All,
    Could anyone help me to store the contents of a text file (*.txt,*.xml etc)directly in to a clob field.
    Thanks in advance
    Jayaram.

    One way is to use sqlloader. Three files are used. A control file, an xml data file, and a file with the path of the xml data file. Here's the control file. It reads load.file, which is the file with the path of the xml data file. It names the path ext_path, and inserts the xml into field xml_field.
    CONTENTS OF CONTROL FILE:
    load DATA
    INFILE 'load.file'
    APPEND
    INTO TABLE xml_table
    ( ext_path FILLER CHAR(13),
    "XML_FIELD" LOBFILE(ext_fname) TERMINATED BY EOF
    CONTENTS OF FILE LOAD.FILE:
    /tmp/load.dat
    The xml is in the file /tmp/load.dat.
    null

  • Inserting data into a CLOB Field

    I am trying to insert a 100,000+ byte string into a CLOB field in Oracle, but I'm getting a "string literal too long" error. I am using Visual Basic and ADO to try to accomplish this. My insert statement is:
    sql = "INSERT INTO IMAGE_VERSION " & _
    "(field1, field2, field3)" & _
    "VALUES('" & strNm & "', '" & strDt & "', '" & strData & "')"
    Field 3 is defined as a CLOB in the database. From what I understand, the CLOB can hold massive amounts of data.
    Can anyone lend a hand?

    Re: OTN Downloads

  • Export CLOB field (long= 4202083) to a file with UTL_FILE.PUT or PUT_LINE

    Hello,
    I'm trying to export a CLOB field to a txt file. It's a xml string in the CLOB. I have used different methods but the only which i can use is PUT, PUT_LINE.
    But:
    - PUT does only export the 32565 characters. I see that the output of l_pos is 4202084 but these are not exported. I have tried FFLUSH, but this gives a error or my syntax is not correct.
    - PUT_LINE is exporting the complete CLOB, but after every 32656 is new line is added and if I want to look with altove then I have to remove 129 times the new line. Thats not the way I want to go.
    Is it an idea, if it is possible, that I write 32565 chars to the buffer (file), read these 32565 from the buffer minus one (=without \r\n), delete the last 32565 chars from buffer and append/put the chars 32565 minus the \r\n to the buffer again. I hope there will be a better idea but....
    Has anybody an idea how I can solve this? Or what do I wrong?
    Any help would be appreciated.
    Beneath my code.
    Nico
    CREATE OR REPLACE DIRECTORY documents AS 'D:\TEST';
    SET SERVEROUTPUT ON
    DECLARE
      l_file    UTL_FILE.FILE_TYPE;
      l_clob    CLOB;
      l_buffer  VARCHAR2(32767);
      l_amount  BINARY_INTEGER := 32565;
      l_pos     INTEGER := 1;
      l_lengte  number;
      l_lineCount number := 0;
    BEGIN
      SELECT PAYLOAD
      INTO   l_clob
      FROM   icepayloadext ext
      WHERE  EXT.PAYLOADTYPE in ('POST')
        AND  substr(payload, 0, 2000) like '%181015%'
        AND  ext.LSTIME between to_date('10-10-2012 00:00:00', 'dd-mm-rrrr HH24:mi:ss') and to_date('10-10-2012 17:30:00', 'dd-mm-rrrr HH24:mi:ss');
      l_lengte := DBMS_LOB.GETLENGTH (l_clob);
      DBMS_OUTPUT.PUT_LINE('lengte clob veld: ' || l_lengte);
      l_file := UTL_FILE.fopen('DOCUMENTS', 'Sample1.txt', 'w', 32767);
      LOOP
        DBMS_LOB.read (l_clob, l_amount, l_pos, l_buffer);
        UTL_FILE.PUT(l_file, l_buffer);
        UTL_FILE.FFLUSH (l_file);
        --UTL_FILE.PUT_LINE(l_file,'alles geschreven');
        l_pos := l_pos + l_amount;
        DBMS_OUTPUT.PUT_LINE('Offset position: ' || l_pos);
        if (l_pos > l_lengte) then
            exit;
        end if;
      END LOOP;
      UTL_FILE.fclose(l_file);
    --EXCEPTION
      --WHEN OTHERS THEN
      --  DBMS_OUTPUT.put_line(SQLERRM);
        --UTL_FILE.fclose(l_file);
    END;
    /

    You can always try it the binary way:
    DECLARE
      l_file UTL_FILE.FILE_TYPE;
      l_clob CLOB;
      l_buffer VARCHAR2(32767);
      l_amount BINARY_INTEGER := 32565;
      l_pos INTEGER := 1;
      l_lengte number;
      l_lineCount number := 0;
    BEGIN
      l_clob := rpad( to_clob( 'test' ), 60000, 'test' );
      l_lengte := DBMS_LOB.GETLENGTH (l_clob);
    DBMS_OUTPUT.PUT_LINE('lengte clob veld: ' || l_lengte);
      l_file := UTL_FILE.fopen( 'MY_DIR', 'Sample1.txt', 'wb', 32767 );
      LOOP
        begin
          DBMS_LOB.read (l_clob, l_amount, l_pos, l_buffer);
        exception
          when no_data_found then exit;
        end;
    --    UTL_FILE.PUT_RAW( l_file, utl_raw.cast_to_raw( l_buffer ) ); -- file in database character set
        UTL_FILE.PUT_RAW( l_file, utl_i18n.string_to_raw( l_buffer, 'WE8MSWIN1252' ) );
        l_pos := l_pos + l_amount;
    DBMS_OUTPUT.PUT_LINE('Offset position: ' || l_pos);
      END LOOP;
      UTL_FILE.fclose(l_file);
    END;Anton

  • Using Oracle Text with CLOB field containing multiple languages

    I'm using Oracle 10g (NLS_CHARACTERSET is set to. AL32UTF8) and have a table with a CLOB field which is storing text written in either English and/or Simplified Chinese.
    The following index has been created on this field:
    CREATE INDEX text_index
    ON text_table(text_field)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS('FILTER CTXSYS.INSO_FILTER');
    I'm having issues in returning text which matches the Chinese text using the CONTAINS operator. For some reason the following query is returning rows which do not contain any Chinese text:
    SELECT *
    FROM text_table
    WHERE contains(text_field,'炫%') > 1;
    A newsgroup user advised me to produce an explain plan using ctx_query.explain.
    I created 2 explain plans, one which was searching the index for 'A%' and the other searching for the Simplified Chinese character '炫%'. The results for the first test were as expected whereby the values contained within the OBJECT_NAME field all began with the letter 'A'.
    The second test however produced somewhat unexpected results. The OBJECT_NAME field this time contained various words, both English and Simplified Chinese. I could be wrong but it appeared to store every individual word in the CLOB field. Both tests produced different EQUIVALENCE rows, the first test was:
    OPTIONS = Null
    OBJECT_NAME = A%
    Whereas the second test produced:
    OPTIONS = (?)
    OBJECT_NAME = %
    Am I right in thinking the Simplified Chinese character is for some reason being converted to a '?' character?
    Any help on this will be much appreciated.

    As you're not specifying a lexer to use, it will use the BASIC_LEXER, designed for space-separated European-type languages. This won't work effectively with Chinese.
    If you know which documents are Chinese and which are English, you can write this into a LANGUAGE column and use the MULTI_LEXER - this will allow you to specify BASIC_LEXER for the English texts, and CHINESE_LEXER or CHINESE_VGRAM_LEXER for the Chinese texts.
    If you don't know the language, you must use either WORLD_LEXER (10g) or AUTO_LEXER (11g). These lexers will automatically determine the language of the documents and index them appropriately. In general. MULTI_LEXER will be faster and more accurate than either of the automatic alternatives.
    When querying for Chinese characters you need to be very careful with your NLS_LANG settings. You need to make sure that the character set defined in NLS_LANG is the same as the character set from which you've pasted (or typed) the chinese characters.
    The "?" in output usually just means "I don't know how to translate this character into your output character set". Sometimes it may appear as a reversed question mark.

Maybe you are looking for

  • IBook won't boot after broken wireless connection trying to update OS

    Trying to help my kid with his iBook via telephone calls. He was updating the OS over a wireless connection, lost the signal which apparently froze the machine. When he rebooted it wouldn't go past the blue start-up screen with a spinning gear. He's

  • Reg : User name and table spaces

    Hi all, I want to show all the user names in DB and total table apace , Occupied spaceand free space . Please help on this, Thanks in advance .

  • Create WebServices invoking a Report (with params)

    I'm using oracle reports 9iAs on a web appl; another one need to call my reports. My idea is create a Web Service that run my reports. It's possible? Oracle Reports support Web Services? Thanks Ugo

  • Unable to connect backend applications through EP in DMZ1 firewall?

    Dear all, To brief our landscape, its look like below. Internet -> DMZ1(Webservers)->Portal(DMZ2)->Internal(Backend Systems). We tried to access the backend systems through portal in DMZ2..its working fine. When we tried to access the portal in DMZ1.

  • How to debug IDOC_OUTPUT_DESADV01 function customer exist

    Hi, I have requirment to add some logic on LVED2FZZ exit, I have added the logic but it is not working as expected. I have put the break points in IDOC_OUTPUT_DESADV01 function module   PERFORM SEGMENTS_FILL -> PERFORM SEND_SEGMENT_E1EDK07_DESADV ->