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

Similar Messages

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

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

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

  • 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

  • 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

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Creating a new Column for my list Versus adding it from existing site columns, when to use each approach

    I have created a new issue tracking list inside SharePoint 2013 team site. And it comes with predefined columns, some of them are useful while the other are not . Can anyone help me in figuring out the following:-
    The list come with a field named “Assigned To”, while in my case I want a column named “Approver”. So what is preferred , to re-name the “Assumed to ”column to “Approver”, or create new field name “Approver”.?.
    If I rename an existing column, could this be overridden in any future updates for my SharePoint server?
    Now we want to add a column named “Office location”.so I need to create a new field for this. But seems there are two ways to do so either to add a new Site Column at the site level and then assign it to the list as follow :- 
    , or to directly adding a column to the list, even if it is not available in the site columns , as follow:-
    So what are the differences between the two approaches ? .if I am not wrong defining a site column will allow me to re-use it in another list , but defining the column at the list level, will allow me to add a column even if it is already defined as site
    column.
    So can anyone advice on my three questions please? Thanks

    1) 'Assigned to' has a different meaning then 'Approver' , it will be better if you create a new field for 'Approver'. Assigned to is a Site Column which has managed property for search, so it will be confusing type of data it will return from search in
    future. 
    2) Any rename of fields should not / and will not get modified in SharePoint updates. So, you can rename is without any issue since the internal name will remain the same. But its always better to create your own custom column for business use.
    3) Creating a site column or not depends upon your need, If you create a Site Column - in whole site collection you will be able to add this field in any list - It will be crawled, SharePoint will automatically provide managed property for site column and
    you will be able to get this value via search. These things will not be present in list column, you will need to do specific settings in case its required.
    If these things are needed then you can go for Site Column, usually its good to create a Site Column and use it.
    For Site Columns you can check following links 
    Introduction to Columns
    From site column to managed property - What's up with that?
    Create a site column
    get2pallav
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.
    thanks a lot for your reply it is really helpful. so as i understand that using site columns will be better in most cases, and there is not any specific reason for not using it? is this right ?
    Second question, do u mean that if i have a list column named "Serial number", then this column will not be searched ? For example if i have serial number such as "12345" and i try searching this text "12345" i will not get
    the item in my search ?
    Thanks

  • Display checkbox for VARCHAR2(1) column

    Hi, I'm getting all of my stupid questions out this week...
    I have a table with a VARCHAR2(1) column that I restrict to 'Y' or NULL to make a boolean/flag column.
    How do I get JDeveloper/ADF to treat this as a boolean column and display a checkbox?
    In Oracle Designer you could flag the field as boolean and the value 'Y' as checked. Not sure how to do this in JDeveloper.

    Gordon,
    All stupid questions are welcome if they are properly specified ;)
    In your case Create an EO/VO. Attach it to a AM. A Data Control will be created. YOu can then use the attribute in your page and dispaly it as a selectBooleanCheckBox.
    Google for how to create EO/VO/AM and Data Control.

  • 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

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

  • 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

  • Getting Error while creating a new column in a list or library in a site collection - Sharepoint 2013

    Hi,
    I am getting below error when i create a new column in a library or list,
    "Save Conflict
    Your changes conflict with those made concurrently by  another user. IF you want your changes to be applied, click back in your browser, refresh the page, and resubmit your changes"
    Any help please.
    Smile Always

    Hi,
    I have done a test in my SharePoint 2013. And I can re-appear your issue.
    Per my test, I found that If  there are more than one user create a new column in
    a library or list at the same time, when we
    click ok after the other users, we will get the error.
    Or if we open a library or list in two windows with the same user, when we
    create a new column in a library or list in two windows
    at the same time, we will get the error.
    To resolve your issue, refresh your page and
    create a new column again.
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • How to Create a new column from two different result sets

    How to Create a new column from two different result sets, both the result set uses the different date dimensions.

    i got solutions for this is apply filters in column formula it self, based on the requirement.

Maybe you are looking for