BC4J varchar2(4000) textareacontrol

I have database fields that are varchar2(4000). I map these to a textareacontrol and nothing shows. I use the 'tester' and nothing shows. I doublecheck the record using SQL/Plus and the field is populated. Any suggestions on what I might be doing wrong?
null

Problem resolved. I rebooted my machine and the application displays the stuff correctly now.

Similar Messages

  • Need help in parsing a VARCHAR2(4000 BYTES) field

    Hi Guys,
    Let me give the DB information first:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    My problem is: The frontend of the application sends a large string into the VARCHAR2 (4000 BYTES) field. The string it sends is somewhat like this -
    <strong>Crit:</strong> Some text. <br><strong>Distinguished</strong> (points 3):Some comment text1. <blockquote> </blockquote><strong>Crit:</strong> Some other text.<br><strong>Distinguished</strong> (points 3):Some comment text2. <blockquote> </blockquote><strong>Crit:</strong> Some more text. <br><strong>Distinguished</strong> (points 3):Some comment text3. <blockquote> </blockquote><strong>Overall comments:</strong><br> Final text!!I want to parse the text and put into separate columns. Number of Crit: can be more than 3; its 3 up there. But the basic structure is same. What is the best possible way of parsing this in PL/SQL code? I want something like
    Table 1
    Crit                       Points           Comment
    Some text                3        Some comment text1.
    Some other text        3        Some comment text2.
    Some more text        3        Some comment text3.
    Table 2
    Overall comments
    Final text!!Please let me know, if you need further information.
    Thanks.
    Edited by: 794684 on Sep 14, 2010 4:15 AM
    Edited by: 794684 on Sep 14, 2010 4:38 AM
    Edited by: 794684 on Sep 14, 2010 4:53 AM
    Edited by: 794684 on Sep 14, 2010 6:42 AM

    Welcome to the forum.
    Looks like noformat tags are not working.Please use the {noformat}{noformat} tag if you want to post formatted examples/code.
    For example, when you type:
    {noformat}select *
    from dual;
    {noformat}
    it will appear as:select *
    from dual;
    when you post it on this forum...
    The FAQ will explain the other options you have: http://forums.oracle.com/forums/help.jspa                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Forms - Input field larger than VARCHAR2(4000)?

    Maybe I'm confused, but it doesn;t seem possible to create a form with a field larger than VARCHAR2(4000) with the builder - if you choose CLOB or LONG for a field type in the Database Object you want to use with your Form, the form builder doesn't display that field.
    So how do I make an input field that will accept a large amount of character data?

    It's a limitation, this is not been fixed until release 10.2.0.x.
    quota readme.txt:
    * Binding more than 8000 bytes data to a table containing LONG
    columns in one call of PreparedStatement.executeUpdate() may
    result in an ORA-22295 error.

  • Advice on creating VARCHAR2(4000) columns

    Hi there
    I've a question regarding table(s) design. Following is a table, which has about 10,000 rows.
    As you can see there are two VARCHAR2(2000) columns.
    All rows have these columns with data which are always "full" (avglength = 2000).
    CREATE TABLE L_PROC
    NUM NUMBER(9) NOT NULL,
    TEC VARCHAR2(10 BYTE) NOT NULL,
    ATE DATE NOT NULL,
    PRO NUMBER(4) NOT NULL,
    NPR NUMBER(7) NOT NULL,
    DOC NUMBER(2) DEFAULT 0 NOT NULL,
    COC NUMBER(2) DEFAULT 0 NOT NULL,
    FOC NUMBER(2) DEFAULT 0 NOT NULL,
    SIT CHAR(1 BYTE) NOT NULL,
    EST CHAR(1 BYTE) DEFAULT 'A' NOT NULL,
    DEN DATE NOT NULL,
    SOL NUMBER(9) NOT NULL,
    LOC VARCHAR2(80 BYTE),
    CEE NUMBER(3),
    CTE VARCHAR2(10 BYTE),
    DEC NUMBER(2) DEFAULT null,
    DIA VARCHAR2(2000 BYTE),
    RES      VARCHAR2(2000 BYTE),
    OUT VARCHAR2(80 BYTE),
    NTS VARCHAR2(80 BYTE),
    ETS VARCHAR2(40 BYTE),
    DAL TIMESTAMP(6) NOT NULL
    When record is created in table, DIA is always filled. Then RES will be updated later.
    Now end-users ask for modification which consists in alter these two column to VARCHAR2(4000).
    I'm thinking on create these two columns in a separated table (perhaps using blob or clob), but I'd like to have some advice on this.
    I'm a bit worried about chained rows.
    Can you help me on this ? What solution do you think is better ?
    Thank you in advance.
    Best Regards,
    Helena

    Replying to Maurice questions:
    do you mostly access your table via index or full table scan?
    mostly via index
    how many rows do you access when you execute a select against this table?
    using users criteria the first step is to perform a select count(*) using that criteria; table data is displayed to the user if the result of count(*) is <= 100 rows
    how often do you query the RES and DIA columns?
    never queried, but always displayed; that means never used in WHERE clauses
    how often are inserts and updates executed against this table?
    about 100/day inserts and the same number of updates (which are performed by another user later)
    which is you DB block size?
    16 KB
    which is the average sizes of the columns RES and DIA?
    1900 (will probably increase +1000 chars)
    do you have currently any kind of performance bottleneck (IO/CPU)?
    not yet...
    Helena

  • Converting 7.3.4 LONGs to 8.1.7 Varchar2(4000)

    Hello all,
    I have a table in 7.3.4 that has a long field because the data was just about 3500 characters long. Now we are upgrading to 8.1.7 and I want to change all the long fields to varchar2(4000) and insert the data. Can anyone tell me how to do this?
    Thanks.

    You can create column of CLOB datatype and use TO_LOB function to convert long into CLOB.
    add a column with CLOB datatype then insert data from long to clob and then drop long column.
    or create another table similar to original one but clob column instead of long column. insert data into new table then rename both tables accordingly.
    Ajwat

  • External table varchar2(4000 byte) field storing 255 bytes only

    Hi all,
    wondering if someone can tell me what im missing here.
    I have an external table with a column defined as varchar2(4000 byte). the file has a row in it with 255 characters (all number 2's for simplicity). when i query the table all is well. if i add 1 more 2 to the string (256 chars) it fails. im sure its something stupidly simple but what am i missing? shouldnt it query fine until 4000 chars?
    thanks,
    Dave

    I ran your testcase, thanks for that.
    Make sure to read the SQL and PL/SQL FAQ as well (the first sticky thread on this forum), it explains how to post formatted code and lots of other stuff.
    Anyway, .log file gave me:
    LOG file opened at 07/18/11 20:05:33
    Field Definitions for table DAVEP2
      Record format DELIMITED, delimited by 0A
      Data in file has same endianness as the platform
      Rows with all null fields are accepted
      Fields in Data Source:
        MY_STRING                       CHAR (255)
          Terminated by ","
          Enclosed by """ and """
          Trim whitespace same as SQL LoaderSo, what happens if you create the table as follows:
    CREATE TABLE davep2 (
       my_string         VARCHAR2(4000 BYTE)         NULL
    ORGANIZATION EXTERNAL
       (  TYPE ORACLE_LOADER
          DEFAULT DIRECTORY FILE_TEST
          ACCESS PARAMETERS
            ( RECORDS DELIMITED BY  0x'0A'  BADFILE FILE_TEST:'davep2.bad'
      LOGFILE FILE_TEST:'davep2.log'
      FIELDS TERMINATED BY ',' optionally enclosed by '"' and '"'
      missing field values are null
               my_string char(4000)
          LOCATION (FILE_TEST:'DaveP.csv')) REJECT LIMIT 0 NOPARALLEL

  • ORA-01461 Error when mapping table with multiple varchar2(4000) fields

    (Note: I think this was an earlier problem, supposed fixed in 11.0, but we are experiencing in 11.7)
    If I map an Oracle 9i table with multiple varchar2(4000) columns, targeting another Oracle 9i database, I get the ORA-01461 error (Can't bind a LONG value only for insert into a LONG).
    I have tried changing the target columns to varchar2(1000), as suggested as a workaround in earlier versions, all to no avail.
    I can have just one varchar2(4000) map correctly and execute flawlessly - the problem occurs when I add a second one.
    I have tried making the target column a LONG, but that does not solve the problem.
    Then, I made the target database SQL Server, and it had no problem at all, so the issue seems to be Oracle-related.

    Hi Jon,
    Thanks for the feedback. I'm unable to reproduce the problem you describe at the moment - if I try to migrate a TEXT(5), OMWB creates a VARCHAR(5) and the data migrates correctly!! However, I note from you description that even though the problematic source column datatype is TEXT(5), you mention that there are actually 20 lines of text in this field (and not 5 variable length characters as the definition might suggest).
    Having read through some of the MySQL reference guide I note that, in certain circumstances, MySQL actually changes the column datatype specified either at table creation time or when interfacing with other databases ( ref 14.2.5.1 Silent Column Specification Changes and 12.7 Using Column Types from Other Database Engines in the MySQL reference guide). Since your TEXT(5) actually contains 20 lines of text, MySQL (database or JDBC driver .... or both) may be trying to automatically map the specified datatype of the column to a datatype more appropriate to storing 20 lines of text.... that is, to a LONG value in this case. Then, when Oracle is presented with this LONG value to store in a VARCHAR(5) field, it throws the ORA-01461 error. I need to investigate this further, but this may be the case - its the first time I've see this problem encountered.
    To workaround this, you could change the datatype of the column to a LONG from within the Oracle Model before migrating. Any application code that accesses this column and expects a TEXT(5) value may need to be adjusted to cope with a LONG value. Is this a viable workaround for you?
    I will investigate further and notiofy you of any details I uncover. We will need to track this issue for possible inclusion in future development plans.
    I hope this helps,
    Regards,
    Tom.

  • Concurrency violation with an update of a VARCHAR2(4000)

    I receive this error when I try to update a record with a field in VARCHAR2(4000).
    System.Data.DBConcurrencyException: Concurrency violation: the UpdateCommand affected 0 records.
    at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
    at Oracle.DataAccess.Client.OracleDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
    at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable)
    I used the OracleCommandBuilder in transactional mode to update the db.
    I have no error if there are few characters in the field, but the error occurs if the field is practically filled. Im sure there is nobody else updating this table.
    I have the same error with the beta2 and the released version.

    This is in the odp.net readme file:
    Size of the data inserted in a Varchar2 column using OracleDbType.Varchar2 parameter type is limited to 2000 characters.
    [bug #1868843, bug #2420617]
    The concurrency error is because 0 records updated.. but the reason why 0 records were updated is probably because of the above.
    Hope that helps..
    -Andrew Douglas

  • Parse XML that is stored in portions in VARCHAR2(4000)

    Hello,
    I have to query data from a third party application, so don't blame me for the data model :-)
    The XML is stored in a VARCHAR2(4000) column and when it has more then 4000 characters it is split into parts with a sequence to identify the order.
    Example:
    DROP TABLE junk_xml;
    CREATE TABLE junk_xml(
        id       INTEGER -- content id
       ,nr       INTEGER -- content sequence
       ,fragment VARCHAR2(4000)
    INSERT INTO junk_xml (id,nr,fragment)
    VALUES (0,1,'<?xml version="1.0" encoding="UTF-8"?>
    <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02 camt.053.001.02.xsd">
        <BkToCstmrStmt>
            <GrpHdr>
                <MsgId>27632364572</MsgId>
                <CreDtTm>2008-09-01T19:30:47.0+01:00</CreDtTm>
                <MsgRcpt>
                    <Id>
                        <OrgId>
                            <Othr>
                                <Id>BCS45678</Id>
                            </Othr>
                        </OrgId>
                    </Id>
                </MsgRcpt>
                <MsgPgntn>
                    <PgNb>1</PgNb>
                    <LastPgInd>true</LastPgInd>
                </MsgPgntn>
            </GrpHdr>
            <Stmt>
                <Id>2736482736482</Id>
                <ElctrncSeqNb>101</ElctrncSeqNb>
                <LglSeqNb>32</LglSeqNb>
                <CreDtTm>2008-09-01T17:30:47.0+01:00</CreDtTm>
                <Acct>
                    <Id>
                        <IBAN>DE62210500001234567890</IBAN>
                    </Id>
                    <Ccy>EUR</Ccy>
                    <Ownr>
                        <Nm>Name Kontoinhaber</Nm>
                    </Ownr>
                    <Svcr>
                        <FinInstnId>
                            <BIC>BANKDEFFXXX</BIC>
                            <Othr>
                                <Id>123456789</Id>
                                <Issr>UmsStId</Issr>
                            </Othr>
                        </FinInstnId>
                    </Svcr>
                </Acct>
                <Bal>
                    <Tp>
                        <CdOrPrtry>
                            <Cd>PRCD</Cd>
                        </CdOrPrtry>
                    </Tp>
                    <Amt Ccy="EUR">112.72</Amt>
                    <CdtDbtInd>CRDT</CdtDbtInd>
                    <Dt>
                        <Dt>2008-09-01</Dt>
                    </Dt>
                </Bal>
                <Bal>
                    <Tp>
                        <CdOrPrtry>
                            <Cd>CLBD</Cd>
                        </CdOrPrtry>
                    </Tp>
                    <Amt Ccy="EUR">158780.32</Amt>
                    <CdtDbtInd>CRDT</CdtDbtInd>
                    <Dt>
                        <Dt>2008-09-01</Dt>
                    </Dt>
                </Bal>
                <!-- Beispiel 1: SEPA-Zahlungen (Ueberweisung, Lastschrift, R-Nachricht -->
                <!--Gutschrift aufgrund eines SEPA-Ueberweisungseinganges-->
                <Ntry>
                    <Amt Ccy="EUR">100.00</Amt>
                    <CdtDbtInd>CRDT</CdtDbtInd>
                    <Sts>BOOK</Sts>
                    <BookgDt>
                        <Dt>2008-09-01</Dt>
                    </BookgDt>
                    <ValDt>
                        <Dt>2008-09-01</Dt>
                    </ValDt>
                    <AcctSvcrRef>Bankreferenz</AcctSvcrRef>
                    <BkTxCd/>
                    <NtryDtls>
                        <TxDtls>
                            <Refs>
                                <EndToEndId>');
    INSERT INTO junk_xml (id,nr,fragment)
    VALUES (0,2,'Ende-zu-Ende-Id des Ueberweisenden</EndToEndId>
                            </Refs>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NTRF+166</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
                            <RltdPties>
                                <Dbtr>
                                    <Nm>Herr Ueberweisender</Nm>
                                </Dbtr>
                                <DbtrAcct>
                                    <Id>
                                        <IBAN>DE21500500001234567897</IBAN>
                                    </Id>
                                </DbtrAcct>
                                <UltmtDbtr>
                                    <Nm>Herr Debtor Reference Party</Nm>
                                </UltmtDbtr>
                                <Cdtr>
                                    <Nm>Herr Kontoinhaber</Nm>
                                </Cdtr>
                                <UltmtCdtr>
                                    <Nm>Herr Creditor Reference Party</Nm>
                                </UltmtCdtr>
                            </RltdPties>
                            <Purp>
                                <Cd>GDDS</Cd>
                            </Purp>
                            <RmtInf>
                                <Ustrd>Rechnungsnr. 4711 vom 20.08.2008</Ustrd>
                            </RmtInf>
                        </TxDtls>
                    </NtryDtls>
                    <AddtlNtryInf>SEPA GUTSCHRIFT</AddtlNtryInf>
                </Ntry>
                <!--Gutschrift aufgrund einer zurueckgekommenen SEPA-Ueberweisung-->
                <Ntry>
                    <Amt Ccy="EUR">200.00</Amt>
                    <CdtDbtInd>CRDT</CdtDbtInd>
                    <Sts>BOOK</Sts>
                    <BookgDt>
                        <Dt>2008-09-01</Dt>
                    </BookgDt>
                    <ValDt>
                        <Dt>2008-09-01</Dt>
                    </ValDt>
                    <AcctSvcrRef>Bankreferenz</AcctSvcrRef>
                    <BkTxCd/>
                    <NtryDtls>
                        <TxDtls>
                            <Refs>
                                <EndToEndId>Urspr. E2E-Id der Hintransaktion</EndToEndId>
                            </Refs>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NTRF+159++901</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
                            <RmtInf>
                                <Ustrd>Angabe des urspruenglichen Verwendungszweckes</Ustrd>
                            </RmtInf>
                            <RtrInf>
                                <OrgnlBkTxCd>
                                    <Prtry>
                                        <Cd>NTRF+116</Cd>
                                        <Issr>ZKA</Issr>
                                    </Prtry>
                                </OrgnlBkTxCd>
                                <Orgtr>
                                    <Id>
                                        <OrgId>
                                            <BICOrBEI>BANKDEHH</BICOrBEI>
                                        </OrgId>
                                    </Id>
                                </Orgtr>
                                <Rsn>
                                    <Cd>AC01</Cd>
                                </Rsn>
                                <AddtlInf>IBAN FEHLERHAFT</AddtlInf>
                            </RtrInf>
                        </TxDtls>');
    INSERT INTO junk_xml (id,nr,fragment)
    VALUES (0,3,'
                    </NtryDtls>
                    <AddtlNtryInf>SEPA RUECKBUCHUNG</AddtlNtryInf>
                </Ntry>
                <!--Belastung aufgrund einer SEPA-Lastschrift-->
                <Ntry>
                    <Amt Ccy="EUR">50.00</Amt>
                    <CdtDbtInd>DBIT</CdtDbtInd>
                    <Sts>BOOK</Sts>
                    <BookgDt>
                        <Dt>2008-09-01</Dt>
                    </BookgDt>
                    <ValDt>
                        <Dt>2008-09-01</Dt>
                    </ValDt>
                    <AcctSvcrRef>Bankreferenz</AcctSvcrRef>
                    <BkTxCd/>
                    <NtryDtls>
                        <TxDtls>
                            <Refs>
                                <EndToEndId>E2E-Id vergeben vom Glaeubiger</EndToEndId>
                                <MndtId>Ref. des SEPA-Lastschriftmandats</MndtId>
                            </Refs>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NDDT+105</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
                            <RltdPties>
                                <Dbtr>
                                    <Nm>Herr Zahlungspflichtiger</Nm>
                                </Dbtr>
                                <UltmtDbtr>
                                    <Nm>Herr Debtor Reference Party</Nm>
                                </UltmtDbtr>
                                <Cdtr>
                                    <Nm>Glaeubigerfirma</Nm>
                                    <Id>
                                        <PrvtId>
                                            <Othr>
                                                <Id>Cdtr-Id des Glaeubigers</Id>
                                            </Othr>
                                        </PrvtId>
                                    </Id>
                                </Cdtr>
                            </RltdPties>
                            <Purp>
                                <Cd>PHON</Cd>
                            </Purp>
                            <RmtInf>
                                <Ustrd>Telefonrechnung August 2009, Vertragsnummer 3536456345</Ustrd>
                            </RmtInf>
                        </TxDtls>
                    </NtryDtls>
                    <AddtlNtryInf>SEPA LASTSCHRIFT</AddtlNtryInf>
                </Ntry>
                <!-- Beispiel 2: DTAUS-Zahlungen (Ueberweisung, Lastschrift, Rueckgabe) -->
                <!--Gutschrift aufgrund eines DTA-Überweisungseinganges-->
                <Ntry>
                    <Amt Ccy="EUR">100.00</Amt>
                    <CdtDbtInd>CRDT</CdtDbtInd>
                    <Sts>BOOK</Sts>
                    <BookgDt>
                        <Dt>2008-09-02</Dt>
                    </BookgDt>
                    <ValDt>
                        <Dt>2008-09-02</Dt>
                    </ValDt>
                    <AcctSvcrRef>Bankreferenz aus DTA C-Satz Feld 6</AcctSvcrRef>
                    <BkTxCd/>
                    <NtryDtls>
                        <TxDtls>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NTRF+051++000</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
                            <RltdPties>
                                <Dbtr>');
    INSERT INTO junk_xml (id,nr,fragment)
    VALUES (0,4,'
                                    <Nm>Herr Überweisender</Nm>
                                </Dbtr>
                                <DbtrAcct>
                                    <Id>
                                        <Othr>
                                            <Id>1234567890</Id>
                                        </Othr>
                                    </Id>
                                </DbtrAcct>
                            </RltdPties>
                            <RmtInf>
                                <Ustrd>Rechnungsnr 4711 - Warenlieferung vom 20.08.2008</Ustrd>
                            </RmtInf>
                        </TxDtls>
                    </NtryDtls>
                    <AddtlNtryInf>ÜBERWEISUNGSGUTSCHRIFT</AddtlNtryInf>
                </Ntry>
                <!--Gutschrift aufgrund einer zurückgekommenen DTA-Überweisung-->
                <Ntry>
                    <Amt Ccy="EUR">200.00</Amt>
                    <CdtDbtInd>CRDT</CdtDbtInd>
                    <Sts>BOOK</Sts>
                    <BookgDt>
                        <Dt>2008-09-02</Dt>
                    </BookgDt>
                    <ValDt>
                        <Dt>2008-09-02</Dt>
                    </ValDt>
                    <AcctSvcrRef>Bankreferenz aus DTA C-Satz Feld 6</AcctSvcrRef>
                    <BkTxCd/>
                    <NtryDtls>
                        <TxDtls>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NTRF+059++511</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
                            <RmtInf>
                                <Ustrd>Angabe des ursprünglichen Verwendungszweckes</Ustrd>
                            </RmtInf>
                            <RtrInf>
                                <OrgnlBkTxCd>
                                    <Prtry>
                                        <Cd>NTRF+051++000</Cd>
                                        <Issr>ZKA</Issr>
                                    </Prtry>
                                </OrgnlBkTxCd>
                                <Orgtr>
                                    <Nm>Herr Überweisungsempfänger</Nm>
                                </Orgtr>
                                <Rsn>
                                    <Prtry>512</Prtry>
                                </Rsn>
                                <AddtlInf>BLZ 25069674 EXISTIERT NICHT</AddtlInf>
                            </RtrInf>
                        </TxDtls>
                    </NtryDtls>
                    <AddtlNtryInf>RÜCKÜBERWEISUNG</AddtlNtryInf>
                </Ntry>
                <!--Belastung aufgrund einer DTA-Lastschrift-->
                <Ntry>
                    <Amt Ccy="EUR">50</Amt>
                    <CdtDbtInd>DBIT</CdtDbtInd>
                    <Sts>BOOK</Sts>
                    <BookgDt>
                        <Dt>2008-09-02</Dt>
                    </BookgDt>
                    <ValDt>
                        <Dt>2008-09-02</Dt>
                    </ValDt>
                    <AcctSvcrRef>Bankreferenz aus DTA C-Satz Feld 6</AcctSvcrRef>
                    <BkTxCd/>
                    <NtryDtls>
                        <TxDtls>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NTRF+005++000</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
    INSERT INTO junk_xml (id,nr,fragment)
    VALUES (0,5,'<RltdPties>
                                <Cdtr>
                                    <Nm>Telefongesellschaft ABC</Nm>
                                </Cdtr>
                            </RltdPties>
                            <RmtInf>
                                <Ustrd>Telefonrechnung August 2009, Vertragsnummer 3536456345</Ustrd>
                            </RmtInf>
                        </TxDtls>
                    </NtryDtls>
                    <AddtlNtryInf>LASTSCHRIFT</AddtlNtryInf>
                </Ntry>
                <!-- Beispiel 3a: Sammlerdarstellung mit Aufloesung innerhalb der Nachricht -->
                <!--Belastung aufgrund von SEPA-Lastschriftrueckgaben (Sammelbuchung) mit Sammleraufloesung unter Transaction Details-->
                <Ntry>
                    <Amt Ccy="EUR">276</Amt>
                    <CdtDbtInd>DBIT</CdtDbtInd>
                    <Sts>BOOK</Sts>
                    <BookgDt>
                        <Dt>2008-09-03</Dt>
                    </BookgDt>
                    <ValDt>
                        <Dt>2008-09-03</Dt>
                    </ValDt>
                    <AcctSvcrRef>Bankreferenz</AcctSvcrRef>
                    <BkTxCd/>
                    <!-- BkTxCd ist Pflichtfeld gemaess ISO, wird jedoch ausschliesslich auf Tx-Ebene verwendet -->
                    <NtryDtls>
                        <Btch>
                            <NbOfTxs>3</NbOfTxs>
                        </Btch>
                        <TxDtls>
                            <!-- Ab hier Aufloesung des Sammlers bestehend aus 3 Einzelumsaetzen -->
                            <Refs>
                                <EndToEndId>79892</EndToEndId>
                                <MndtId>10001</MndtId>
                            </Refs>
                            <AmtDtls>
                                <TxAmt>
                                    <Amt Ccy="EUR">76</Amt>
                                </TxAmt>
                            </AmtDtls>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NTRF+109++901</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
                            <RltdPties>
                                <Dbtr>
                                    <Nm>Herr Zahlungspflichtiger 1</Nm>
                                </Dbtr>
                                <Cdtr>
                                    <Nm>Telefongesellschaft ABC</Nm>
                                    <Id>
                                        <PrvtId>
                                            <Othr>
                                                <Id>CdtrId des SEPA-Lastschrifteinr.</Id>
                                            </Othr>
                                        </PrvtId>
                                    </Id>
                                </Cdtr>
                            </RltdPties>
                            <Purp>
                                <Cd>PHON</Cd>
                            </Purp>
                            <RmtInf>
                                <Ustrd>Telefonrechnung August 2009, Vertragsnummer 3536456345</Ustrd>
                            </RmtInf>
                        </TxDtls>
                        <TxDtls>
                            <Refs>
                                <EndToEndId>768768</EndToEndId>
                                <MndtId>10002');
    INSERT INTO junk_xml (id,nr,fragment)
    VALUES (0,6,'</MndtId>
                            </Refs>
                            <AmtDtls>
                                <TxAmt>
                                    <Amt Ccy="EUR">80</Amt>
                                </TxAmt>
                            </AmtDtls>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NTRF+109++901</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
                            <RltdPties>
                                <Dbtr>
                                    <Nm>Herr Zahlungspflichtiger 2</Nm>
                                </Dbtr>
                                <Cdtr>
                                    <Nm>Telefongesellschaft ABC</Nm>
                                    <Id>
                                        <PrvtId>
                                            <Othr>
                                                <Id>CdtrId des SEPA-Lastschrifteinr.</Id>
                                            </Othr>
                                        </PrvtId>
                                    </Id>
                                </Cdtr>
                            </RltdPties>
                            <Purp>
                                <Cd>PHON</Cd>
                            </Purp>
                            <RmtInf>
                                <Ustrd>Telefonrechnung August 2009, Vertragsnummer 3536456888</Ustrd>
                            </RmtInf>
                        </TxDtls>
                        <TxDtls>
                            <Refs>
                                <EndToEndId>45456465</EndToEndId>
                                <MndtId>10003</MndtId>
                            </Refs>
                            <AmtDtls>
                                <TxAmt>
                                    <Amt Ccy="EUR">120</Amt>
                                </TxAmt>
                            </AmtDtls>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NTRF+109++901</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
                            <RltdPties>
                                <Dbtr>
                                    <Nm>Herr Zahlungspflichtiger 3</Nm>
                                </Dbtr>
                                <Cdtr>
                                    <Nm>Telefongesellschaft ABC</Nm>
                                    <Id>
                                        <PrvtId>
                                            <Othr>
                                                <Id>CdtrId des SEPA-Lastschrifteinr.</Id>
                                            </Othr>
                                        </PrvtId>
                                    </Id>
                                </Cdtr>
                            </RltdPties>
                            <Purp>
                                <Cd>PHON</Cd>
                            </Purp>
                            <RmtInf>
                                <Ustrd>Telefonrechnung August 2009, Vertragsnummer 3536456345</Ustrd>
                            </RmtInf>
                        </TxDtls>
                    </NtryDtls>
                    <AddtlNtryInf>SEPA Direct Debit (Einzelbuchung-Soll, Core)</AddtlNtryInf>
                </Ntry>
                <!-- Beispiel 3b: Sammlerdarstellung mit Verweis auf pain-Nachricht und separate camt.054.001.01-Nachricht -->
                <!--Belastung aufgrund einer SEPA-Ueberweisung (Sammler) mit Verweis auf Original pain-Nachricht-->
                <Ntry>
                    <Amt Ccy="');
    INSERT INTO junk_xml (id,nr,fragment)
    VALUES (0,7,'EUR">100876.00</Amt>
                    <CdtDbtInd>DBIT</CdtDbtInd>
                    <Sts>BOOK</Sts>
                    <BookgDt>
                        <Dt>2008-09-03</Dt>
                    </BookgDt>
                    <ValDt>
                        <Dt>2008-09-03</Dt>
                    </ValDt>
                    <AcctSvcrRef>Bankreferenz</AcctSvcrRef>
                    <BkTxCd/>
                    <NtryDtls>
                        <Btch>
                            <MsgId>MsgId der pain-Nachricht</MsgId>
                            <PmtInfId>Sammler-Id dieser pain-Nachricht</PmtInfId>
                        </Btch>
                        <TxDtls>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NTRF+191</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
                        </TxDtls>
                    </NtryDtls>
                    <AddtlNtryInf>SEPA Credit Transfer (Sammler-Soll)</AddtlNtryInf>
                </Ntry>
                <!--Belastung aufgrund von SEPA-Lastschriftrueckgaben (Sammelbuchung) mit Verweis auf separate camt.054.001.01-Nachricht-->
                <Ntry>
                    <Amt Ccy="EUR">276.00</Amt>
                    <CdtDbtInd>DBIT</CdtDbtInd>
                    <Sts>BOOK</Sts>
                    <BookgDt>
                        <Dt>2008-09-03</Dt>
                    </BookgDt>
                    <ValDt>
                        <Dt>2008-09-03</Dt>
                    </ValDt>
                    <AcctSvcrRef>Bankreferenz</AcctSvcrRef>
                    <BkTxCd/>
                    <AddtlInfInd>
                        <MsgNmId>camt.054.001.01</MsgNmId>
                        <MsgId>054-20090903-00034</MsgId>
                        <!-- siehe Bsp. camt54 Bsp 3b -->
                    </AddtlInfInd>
                    <NtryDtls>
                        <TxDtls>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NTRF+109++901</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
                        </TxDtls>
                    </NtryDtls>
                    <AddtlNtryInf>SEPA Direct Debit (Einzelbuchung-Soll, Core)</AddtlNtryInf>
                </Ntry>
                <!-- Beispiel 4: USD-Zahlung mit Gutschrift auf einem EUR-Konto -->
                <!-- USD-Zahlung mit Gutschrift auf einem EUR-Konto -->
                <Ntry>
                    <Amt Ccy="EUR">259595.60</Amt>
                    <CdtDbtInd>CRDT</CdtDbtInd>
                    <Sts>BOOK</Sts>
                    <BookgDt>
                        <Dt>2008-09-04</Dt>
                    </BookgDt>
                    <ValDt>
                        <Dt>2008-09-04</Dt>
                    </ValDt>
                    <AcctSvcrRef>Bankreferenz</AcctSvcrRef>
                    <BkTxCd/>
                    <NtryDtls>
                        <TxDtls>
                            <AmtDtls>
                                <InstdAmt>
                                    <Amt Ccy="USD">360873.97</Amt>
    INSERT INTO junk_xml (id,nr,fragment)
    VALUES (0,8,'</InstdAmt>
                                <TxAmt>
                                    <Amt Ccy="EUR">259595.60</Amt>
                                </TxAmt>
                                <CntrValAmt>
                                    <Amt Ccy="EUR">259621.56</Amt>
                                    <CcyXchg>
                                        <SrcCcy>USD</SrcCcy>
                                        <TrgtCcy>EUR</TrgtCcy>
                                        <XchgRate>1.39</XchgRate>
                                    </CcyXchg>
                                </CntrValAmt>
                            </AmtDtls>
                            <BkTxCd>
                                <Prtry>
                                    <Cd>NTRF+202</Cd>
                                    <Issr>ZKA</Issr>
                                </Prtry>
                            </BkTxCd>
                            <Chrgs>
                                <Amt Ccy="EUR">25.96</Amt>
                            </Chrgs>
                            <RltdPties>
                                <Dbtr>
                                    <Nm>West Coast Ltd.</Nm>
                                    <PstlAdr>
                                        <Ctry>US</Ctry>
                                        <AdrLine>52, Main Street</AdrLine>
                                        <AdrLine>3733 San Francisco</AdrLine>
                                    </PstlAdr>
                                </Dbtr>
                                <DbtrAcct>
                                    <Id>
                                        <Othr>
                                            <Id>546237687</Id>
                                        </Othr>
                                    </Id>
                                </DbtrAcct>
                            </RltdPties>
                            <RltdAgts>
                                <DbtrAgt>
                                    <FinInstnId>
                                        <BIC>BANKUSNY</BIC>
                                    </FinInstnId>
                                </DbtrAgt>
                            </RltdAgts>
                            <RmtInf>
                                <Ustrd>Invoice No. 4545</Ustrd>
                            </RmtInf>
                        </TxDtls>
                    </NtryDtls>
                    <AddtlNtryInf>AZV-UEBERWEISUNGSGUTSCHRIFT</AddtlNtryInf>
                </Ntry>
            </Stmt>
        </BkToCstmrStmt>
    </Document>');
    COMMIT;
    My first idea was to use LISTAGG to splice the pieces, but I get an ORA-01489: result of string concatenation is too long
    SELECT  XMLTYPE(
                LISTAGG(fragment,'')
                WITHIN GROUP(ORDER BY nr))
    FROM    junk_xml
    WHERE   id = 0
    GROUP BY id;
    I also considered exporting the data into another table using maybe dbms_lob to concatenate the strings, but I'm not allowed to create another table.
    Any idea how I can access the data hidden in this application?
    Regards
    Marcus
    P.S.: The application is not about SEPA-processing, but I don't want to show the real data.

    Hi Marcus,
    This should work nicely :
    select xmlparse(document
             xmlcast(
               xmlagg(xmlforest(fragment) order by nr)
               as clob
           ) as complete_doc
    from junk_xml
    where id = 0 ;

  • Diff between VARCHAR2(4000)  & VARCHAR2(4000 BYTE)

    Hi
    Pls do explain the diff
    a. VARCHAR2(4000) & VARCHAR2(4000 BYTE)
    b. NUMBER & NUMBER BYTE
    Regards
    Yram

    X CHAR means that column should contain X characters regardless of how many bytes they takes. For example latvian specific character ā takes more than 1 byte in some unicode caharctersets, but latin character a only one byte. So in 1 CHAR you will be able to store both ā and a but in 1 BYTE only a.
    One has to remember that 4000 byte maximum limit for varchar column is effective REGARDLESS of 4000 CHAR and you wouldn't be able to store 4000 multi byte characters there. As soon as length in bytes of your string will be greater than 4000 Oracle will throw an error. If I remember correctly, in some earlier 9i version(s) there was a bug that Oracle silently cut the tail after 4000 bytes without an error.
    Gints Plivna
    http://www.gplivna.eu

  • Difference between varchar2(4000 byte) & varchar2(4000 char

    Hi,
    My existing database NLS parameters as follows
    CHARACTER SET US7ASCII
    NATIONAL CHARACTER SET AL16UTF16
    created a test database to support globalization, I changed as follows
    CHARACTER SET UTF8
    NATIONAL CHARACTER SET UTF8
    some of the table column datatypes are varchar2(4000)
    I would like to know what is difference between VARCHAR2(4000 BYTE) and VARCHAR2(4000 CHAR).
    Thanks

    Indeed, VARCHAR2(x BYTE) means that the column will hold as much characters as will fit into x bytes. Depending on the character set and particular characters this may be x or less characters.
    For example, a VARCHAR2(20 BYTE) column in an AL32UTF8 database can hold 20 characters from the ASCII range, 10 Latin letters with umlaut, 10 Cyryllic, 10 Hebrew, or 10 Arabic letters (2 bytes per character), or 6 Chinese, Japanese, Korean, or Devanagari (Indic) characters. Or a mixture of these characters of any total length up to 20 bytes.
    VARCHAR2(x CHAR) means that the column will hold x characters but not more than can fit into 4000 bytes. Internally, Oracle will set the byte length of the column (DBA_TAB_COLUMNS.DATA_LENGTH) to MIN(x * mchw, 4000), where mchw is the maximum byte width of a character in the database character set. This is 1 for US7ASCII or WE8MSWIN1252, 2 for JA16SJIS, 3 for UTF8, and 4 for AL32UTF8.
    For example, a VARCHAR2(3000 CHAR) column in an AL32UTF8 database will be internally defined as having the width of 4000 bytes. It will hold up to 3000 characters from the ASCII range (the character limit), but only 1333 Chinese characters (the byte limit, 1333 * 3 bytes = 3999 bytes). A VARCHAR2(100 CHAR) column in an AL32UTF8 database will be internally defined as having the width of 400 bytes. It will hold up to any 100 Unicode characters.
    The above implies that the CHAR limit works optimally if it is lower than 4000/mchw. With such restriction, the CHAR limit guarantees that the defined number of characters will fit into the column. Because the widest character in any Oracle character set has 4 bytes, if x <= 1000, VARCHAR2(x CHAR) is guaranteed to hold up to x characters in any database character set.
    The declaration VARCHAR2(x):
    - for objects defined in SYS schema means VARCHAR2(x BYTE),
    - for objects defined in other schemas it means VARCHAR2(x BYTE) or VARCHAR2(x CHAR), depending on the value of the NLS_LENGTH_SEMANTICS parameter of the session using the declaration (see the NLS_SESSION_PARAMETERS view).
    After an object is defined, its BYTE vs CHAR semantics is stored in the data dictionary and it does not depend on the NLS_LENGTH_SEMANTICS any longer. Even Export/Import will not change this.
    Character length semantics rules are valid for table columns and for PL/SQL variables.
    -- Sergiusz

  • Why not everytime declare varchar2(4000)?

    hello,
    I am using Oracle 11g.
    I just wanted to know is there anything wrong in every time declaring a field with var char(4000) in pl/sql?
    Thanks

    There is no difference for VARCHAR2 database columns. However some GUI tools may use that information to propose different length of text fields to input/display data. I didn't work with front-end tools since Forms 4.5, but at that time Oracle Designer was able to generate longer text fields for longer database columns (it doesn't mean that these dimensions were always correct).
    There is some difference for PL/SQL VARCHAR2 variables. Memory is allocated differently.
    Oracle Database PL/SQL Language Reference:
    Memory Allocation for Character Variables For a CHAR variable, or for a VARCHAR2 variable
    whose maximum size is less than 2,000 bytes, PL/SQL allocates enough memory for
    the maximum size at compile time. For a VARCHAR2 whose maximum size is 2,000
    bytes or more, PL/SQL allocates enough memory to store the actual value at run time.
    In this way, PL/SQL optimizes smaller VARCHAR2 variables for performance and
    larger ones for efficient memory use.
    For example, if you assign the same 500-byte value to VARCHAR2(1999 BYTE) and
    VARCHAR2(2000 BYTE) variables, PL/SQL allocates 1999 bytes for the former
    variable at compile time and 500 bytes for the latter variable at run time.

  • Cannot insert varchar2 4000 bytes correctly in asp

    I tried to insert 4000 bytes into a filed of varchar2 type
    in an ASP page using bind variables.
    After inserting, I cannot fetch the column correctly. Result was only 2000 bytes.
    In sqlplus I verified that the inserted data was 4000 bytes but a wrong character at 2001 th byte.
    I use oracle 8.1.6.
    This problem is not occurring in JSP.
    Thanks...

    Have you solved your problem yet?
    I think you are experiencing the auto-magical characterset conversions in Windows applications.
    SQL*Plus is still using those non-Unicode Win APIs; on the contrary, your C# application is very probably using the Unicode Win APIs. That means, no matter how you input (Big5 ones, unicode ones, cut-and-paste, .... ), SQL*Plus receives the characters in Big5 form and your C# application receives them in Unicode form. Windows does all the conversions transparently.
    In the SQL*Plus case, the HKSCS characters are in their Big5 UDA/VDA codes. Since both your server and client have NLS_LANG set as ZHT16MSWIN950, these HKSCS Big5 codes are stored in your database intact w/o any conversion. When these characters are displayed, no matter in SQL*Plus or your C# application, they are retrieved in Big5 form and passed to Windows for display. Hence, there is no problem.
    However, when you input these HKSCS characters through your C# application, they are received in Unicode form. I believe that your application is storing these Unicode characters in DB directly and, therefore, they must be converted to "MSWIN950" form by some Oracle components who lacks the full conversion table of Windows. Naturally, HKSCS characters become "??".
    I am not familiar with C# and Windows APIs so I dunno the exact way to solve the problem. Still, the rule-of-thumb is to let Windows does the character set conversions and ensure that the converted data are stored in Oracle w/o further conversions. I think your C# applications should convert the text data from Unicode to Big5 (under Windows) and then save the Big5 data to the “ZHT16MSWIN950” database in Big5 context. This will probably solve your problem.

  • How to convert CLOB to varchar2 whose length is more than 4000

    Hi ,
    I have to retrive the CLOB data into varchar2 and spilt those comma seperated values into rows
    but i am getting following error
    " ORA-06502: PL/SQL: numeric or value error: character string buffer too small "
    the proc i used is like following :
    : create table test_clob (grp_id CLOB, id number)
    Create or replace proc test_clob(p_id number )
    Is
    V_clob CLOB;
    V_str varchar2(4000);
    V_main varchar2(30000);
    TYPE t_clob IS REF CURSOR;
    cur_clob t_clob;
    Begin
    Select grp_id
    Into v_str
    From test_clob
    Where id= p_id;
    ---converting column data in rows as I have to return the cursor as output
    V_main:= ' select grp_id from ( WITH t AS
    (SELECT REGEXP_SUBSTR(''' || v_str ||
    ''', ''[^,]+'', 1, LEVEL) txt
    FROM DUAL
    CONNECT BY LEVEL <=
    LENGTH(''' || v_str ||
    LENGTH(REPLACE(''' || v_str ||
    ''', '','')) + 1)
    SELECT REGEXP_SUBSTR(trim(txt), ''[^\,]+'', 1, 1) grp_id
    FROM t )';
    open cur_clob for ' select rtrim(xmlagg(xmlelement(e, grp_id || '','')).extract (''//text()'').getclobval (),'','') grp_id
    from ( '|| v_main||' ) ';
    loop
    fetch cur_clob
    into V_clob;
    exit when cur_clob %notfound;
    end loop;
    insert into test_clob
    values (p_id, v_clob);
    commit;
    End;
    Please help its very urgent

    957624 wrote:
    Hi ,
    I have to retrive the CLOB data into varchar2 and spilt those comma seperated values into rows
    but i am getting following error
    " ORA-06502: PL/SQL: numeric or value error: character string buffer too small "
    the proc i used is like following :
    : create table test_clob (grp_id CLOB, id number)
    Create or replace proc test_clob(p_id number )
    Is
    V_clob CLOB;
    V_str varchar2(4000);
    V_main varchar2(30000);
    TYPE t_clob IS REF CURSOR;
    cur_clob t_clob;
    Begin
    Select grp_id
    Into v_str
    From test_clob
    Where id= p_id;
    ---converting column data in rows as I have to return the cursor as output
    V_main:= ' select grp_id from ( WITH t AS
    (SELECT REGEXP_SUBSTR(''' || v_str ||
    ''', ''[^,]+'', 1, LEVEL) txt
    FROM DUAL
    CONNECT BY LEVEL <=
    LENGTH(''' || v_str ||
    LENGTH(REPLACE(''' || v_str ||
    ''', '','')) + 1)
    SELECT REGEXP_SUBSTR(trim(txt), ''[^\,]+'', 1, 1) grp_id
    FROM t )';
    open cur_clob for ' select rtrim(xmlagg(xmlelement(e, grp_id || '','')).extract (''//text()'').getclobval (),'','') grp_id
    from ( '|| v_main||' ) ';
    loop
    fetch cur_clob
    into V_clob;
    exit when cur_clob %notfound;
    end loop;
    insert into test_clob
    values (p_id, v_clob);
    commit;
    End;
    Please help its very urgentNo, nothing is urgent here and it is very rude to suggest it is, as well as it being a breach of the terms of use for the forums. Urgent issues relate to commercially live systems, and for those you need to raise a support request with Oracle Support. The forums are manned by volunteers with their own jobs to do, so suggesting they drop everything to help you urgently is very rude. Also, other people asking questions would like answers to theirs as soon as possible too, so suggesting your question is more urgent than theirs is also rude to those people. You will find that suggesting your question is urgent will actually prevent people from helping you on the forums as many people will simply choose to ignore you for your rudeness (either that or they'll be rude back)
    Please read {message:id=9360002} to learn how to ask a question properly.
    Now, in answer to your question...
    What is it you are really trying to do?
    If you have comma seperated data, why it is being stored like that in a CLOB? That seems like bad design for storing data.
    If the data is coming from a file, then you could consider using External Tables (or SQL*Loader) to load the comma seperated data in a structured way.
    If you really have data in a clob in comma seperated format, what are you wanting to do with it exactly i.e. what determines where the data should be split?
    Your code isn't clear, but it looks like, on the one hand you are splitting comma seperated data out of a string, and on the other hand you're turning it into XML to get a clob of data back.
    Please be clear by providing some example data and expected output, along with your database version as explained in the FAQ post I linked to above.

  • Selecting the first 4000 characters from a tag in an xml file

    Oracle Enterprise Edition 11.1.0.7 64 bit (Jan 2012 CPU applied)
    Windows 2003 64 bit
    We have an XML file with the following sample format.
    <?xml version="1.0"?>
    <HR>
    <EMP>
    <FNAME>JOHN</FNAME>
    <LNAME>DOE</LNAME>
    <COMMENT>Comment with less than 4000 characters</COMMENT>
    </EMP>
    <EMP>
    <FNAME>JANE</FNAME>
    <LNAME>DOE</LNAME>
    <COMMENT>Comment with more than 4000 characters</COMMENT>
    </EMP>
    </HR>
    The query below
    (full disclosure: which I took from odie_63's response in Creating External Table using Xml Dataset - how to include null values? and added the CURSOR_SHARING_EXACT hint on the top)
    works when the contents of the <Comment> tag are smaller than 4000 characters. If it is more than 4000 I get
    ORA-01706: user function result value was too large
    SELECT /*+ CURSOR_SHARING_EXACT */
    FROM XMLTable(
    '/HR/EMP'
    passing xmltype( bfilename('DATA_PUMP_DIR','emp.xml'), nls_charset_id('CHAR_CS') )
    columns
    first_name varchar2(30) path 'FNAME',
    last_name varchar2(30) path 'LNAME',
    comments varchar2(4000) path 'COMMENT'
    I found another query where someone was doing a substring (I think to get only the first 4000 characters from the tag) here.
    http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14638197 (See OP's post)
    TERMINATION_DATE VARCHAR(32) path 'TerminateDate/substring(text(), 1, 32)',
    So I updated my query to be
    SELECT /*+ CURSOR_SHARING_EXACT */
    FROM XMLTable(
    '/HR/EMP'
    passing xmltype( bfilename('DATA_PUMP_DIR','emp.xml'), nls_charset_id('CHAR_CS') )
    columns
    first_name varchar2(30) path 'FNAME',
    last_name varchar2(30) path 'LNAME',
    comments varchar2(4000) path 'COMMENT/substring(text(),1,4000)'
    The query runs without an error when the <comment> tag has 4000 or less characters but still errors out with it is more than 4000.
    I found an alternative method to do the SUBSTRING here in Herald ten Dam's reponse in Re: A view over XML that is not 1:1
    code varchar2(30) path 'substring(code,1,3)',
    so I tried this:
    SELECT /*+ CURSOR_SHARING_EXACT */
    FROM XMLTable(
    '/HR/EMP'
    passing xmltype( bfilename('DATA_PUMP_DIR','emp.xml'), nls_charset_id('CHAR_CS') )
    columns
    first_name varchar2(30) path 'FNAME',
    last_name varchar2(30) path 'LNAME',
    comments varchar2(4000) path 'substring(COMMENT,1,4000)'
    but that doesn't work either.
    How can I extract the first 4000 characters of the <COMMENT> tag so that the query doesn't fail.
    We are not using any other XMLDB features at this time. This is the first we've started looking into using Oracle built in XML features, so we might not have setup something that other's might know to specifically setup to start using the XML features in Oracle 11.1
    Thanks in advance,
    Wally

    walls99 wrote:
    This is regardless of the COMMENTS tag being 4000 characters or more and the same with the ideas from Odie.
    WallyNo idea if it is an issue with your version. I don't have your version to test but following works for me. Does this simple test work?
    SQL> select * from v$version ;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> set define off
    SQL> select dbms_xmlgen.convert(xmlserialize(content xmltype('<brand>Ben &amp; Jerry</brand>') as clob), 1) from dual ;
    DBMS_XMLGEN.CONVERT(XMLSERIALIZE(CONTENTXMLTYPE('<BRAND>BEN&AMP;JERRY</BRAND>')A
    <brand>Ben & Jerry</brand>

Maybe you are looking for

  • "#" character showing up when saving as PDF in FM 8?

    Hello, We've used FM for years, for operator and service manuals - we just upgraded to FM8, and have a new problem. When we save as a PDF, we get the # character at random points in the PDF - there is no rhyme or reason for their appearance or their

  • What is an "Accessorize Test" and how do I get out of it?

    When I turned on my 30GB iPod it started doing these test things and I figured out how to do them. But this one I'm stuck on. It says: "Please plug FW LCD ID : 1 FWPWR : 0" Please Help!!!

  • Printing a quotation mark (") in concatenate formula?

    Hi, I'm trying to write a function using  =CONCATENATE() and I want to know how to add a quotation mark to the output without it screwing up the forumula. This doesn't print out the quotation mark " between B2 and B3: =CONCATENATE(B2,""",B3) I've bee

  • SQL Server Virus Attack - Recover main database (MDF) using log (LDF) file

    Hi ! My server was hit by some unknown virus which seems to have corrupted header information for many of our files including an important databases and some of its backups.  However the log file (.LDF) for the live DB was not affected. I also have a

  • Deploy Integration Content menu cannot be found in Eclipse.

    HI, I m new to Integration and im doing HCI integration from Customer master form ERP to C4C using HCI(Eclipse Kelper). when i right click on the Project im unable to find the "Deploy Integration Content"  menu as shown in the figure. Can any one sug