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.

Similar Messages

  • Why Not Use WHEN OTHERS - Friday Question

    There are several people on this forum that abhor use of WHEN OTHERS in the same vein as GOTO (which really is a bad practice).  I have an open mind and am looking for the reason it should be avoided.
    When used to output the state during unexpected exceptions, WHEN OTHES can dramatically reduce debug time.  The only bad exception handler is WHEN OTHERS THEN NULL.  Error logging to a table is important and should include the back trace and call stack in addition to listing pertinent parameter, constant and variable values.  I consider this debug instrumentation.  If you write perfect code or you don't have end users that are very creative in finding bugs that occur because of the convoluted way they get to the code that causes the error you don't need it.  Or you like the thrill of the hunt going slogging through thousands of lines of code to try to figure out what caused the error.  I am lazy and want to have it spelled out for me.  Below is my error logging table (CODE is  a session level transaction identifier used for filtering) and my error logging procedure is equivalent to DBMS_OUTPUT.PUT_LINE.  This makes it easy to take other people's code and replace DBMS_OUTPUT with my error logging.  This becomes very useful for debugging triggers since there is no standard output device.
    CREATE TABLE SUPPORT.MESSAGE_LOGS
      CODE        INTEGER                           NOT NULL,
      TEXT        VARCHAR2(4000 BYTE)               NOT NULL,
      CREATED_ON  TIMESTAMP(6)                      NOT NULL,
      CREATED_BY  VARCHAR2(100 BYTE)                NOT NULL,
      OSUSER      VARCHAR2(100 BYTE),
      MACHINE     VARCHAR2(100 BYTE),
      PROGRAM     VARCHAR2(100 BYTE),
      BACK_TRACE  CLOB,
      CALL_STACK  CLOB
    Typical insert is:
    INSERT INTO message_logs (
                  code,
                  text,
                  created_on,
                  created_by,
                  osuser,
                  machine,
                  program,
                  back_trace,
                  call_stack )
    VALUES      (
                  utilities.get_xaction_sequence,
                  pv_text,
                  SYSTIMESTAMP,
                  UPPER ( utilities.get_session_user ),
                  UPPER ( utilities.get_osuser ),
                  UPPER ( utilities.get_machine ),
                  UPPER ( utilities.get_program ),
                  DBMS_UTILITY.format_error_backtrace,
                  DBMS_UTILITY.format_call_stack
    Typical error text:
    ERROR in UTILITIES.CREATE_FILE: ORA-29280: invalid directory path
    Directory = FILEDIR
    File Name = _Revoke_From_COGNOS_ALL_Script19-MAR-12.SQL
    Linesize = 32000
    Text - 1st chacters = -- File created on 19-Mar-2012 11:16:38

    Hoek wrote:
    C'mon Ed, now shirley you must have an opinion regarding the use of WHEN OTHERS?
    Feel free to share it with us
    My opinion is that I hate it when an application -- any application, under any framework, in any language -- swallows an error message.  As to getting into the weeds of WHEN OTHERS, I tend to agree that it should be avoided but am open to arguments for exceptions.  Does that sound like waffling?  It's not intended to be.  Here's where I have to make a confession.  When I transitioned from the role of "developer" (we called them "programmer/analyst" then) to dba, my shop was also transitioning from IBM's IMS database (hierarchical) to relational databases - first DB2, then as client-sever architecture came in they settled on Oracle as the C/S database.  Because I was viewed as an "early adopter" and had been doing some development work on our first client-server apps, I was tagged to become our first Oracle DBA. (My first oracle db was v7.3 on Win 3.11)   As a result of that path, I never really got heavily into development with PL/SQL.  I can do OK on  individual procedures - mostly for one-off or stand-alone use. But I never developed that mental framework and toolbox of procedures that only comes with working heavily in a language.  
    Don't call me Shirley

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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

  • Why not use "new" operator  with strings

    why we not use new when declaring a String .because in java String are treated as objects. we use new operator for creating an object in java .
    and same problem wiht array when we declare array as well as initialize .here we are alse not using new for array
    why

    Strings aren't just treated as objects, Strings are Objects.
    As for why not using new for Strings, you can, if you want.:
    String str = "this is a string";
    and
    String str = new String("this is a string");
    do the same thing (nitty-gritty low level details about literals aside). Use whatever you like, but isn't it simpler not to type new String(...) since you still need to type the actual string?
    As for arrays, you can use new:
    int[] ints = new int[10];
    or
    int[] ints = { 0, 1, 2, 3, ..., 9 };
    But the difference here is you are creating an empty array in the first one, the second creates and fills the array with the specified values. But which to you often depends on what you are doing.

  • Why interfaces why not abstract classes?

    why they are using interfaces concept in JDBC or struts2.0 why not abstract classes?
    thanks in advance.

    user5287726 wrote:
    jverd wrote:
    user5287726 wrote:
    Interfaces are more flexible. For certain definitions of flexible, yes, but not for others.
    A Java class can only inherit one class, but it can implement multiple interfaces.Which has absolutely nothing to do with why JDBC declares interfaces rather than abstract classes.How does your post even attempt to answer the OP's question?OP asked: "why they are using interfaces concept in JDBC or struts2.0 why not abstract classes?" I'm pointing out that your post does not address the question asked. And of course your answer is wrong anyway.
    As for addressing the OP's question, I did that in my first response.

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

  • C++: error: 'std::unique_ptr' has not been declared

    Hi.  I'm trying to compile some C++ code (that I didn't write) and I keep getting this error
    error: ‘std::unique_ptr’ has not been declared
    I've just got all my .h and .cpp files in one folder, and from there I'm trying
    g++ -std=c++11 *.cpp
    I know this probably looks bad, but I don't have a makefile.
    The real point is, why doesn't gcc recognize unique_ptr when I'm explicitly specifying to g++ to use c++11?

    IIRC, xcode does not use gcc by default; the libraries would be different implementation.  I realize we are talking about std:: here, but perhaps the header files have a different hierarchy.  That, or  Xcode is pulling some slight of hand and helping you without asking.

  • My operating system windows XP not working with photoshop cloud, why not?

    I need to add 2 more licences for photoshop cloud and I'm being told my operating system windows XP does not work with Photoshop cloud. We already have 2 pcs using it in our office so why not?
    Please help
    Roy

    Do you have the latest version of iTunes?  If not, get it at:
    http://www.apple.com/itunes

  • I created an Apple ID using my ISP Email when I registered at the Store/Apple Support Communities/iTunes/Face Time and it does not work in iChat. Why Not ?

    Question:-
    I created an Apple ID using my ISP Email when I registered at the Store/Apple Support Communities/iTunes/Face Time or other portal and it does not work in iChat. Why Not ?
    Answer:-
    For a Name to work in iChat it has to be an Valid AIM screen Name.
    Only Apple IDs from the @mac.com ending names registered here  and the Mobileme (@Me.com ending) names are Valid with the AIM service as well as being Apple IDs
    (I am still working on info about registering with iCloud at the moment but if this does give you an @Me.com email it may well be a valid AIM name as well)
    NOTES:-
    The @mac.com page works by linking an external (Non Apple) email with a @mac.com name.
    This External Email cannot be one linked to an Existing Apple ID (you have to use a second email or register at AIM )
    The options at AIM are to use your existing email or create new name and link the existing only for Password recovery
    MobileMe (@me.com ending names) were valid Emails addresses, Apple IDs AND a Valid AIM Screen Name
    @mac.com names look like emails but are only Apple IDs and iChat/AIM Valid Screen Names.
    The AIM registration page seems to be pushing you to register [email protected] This is relatively new and I have not followed through the pages to find out if it a valid AIM email (Previously you could register a name without an @whatever.com suffix)
    8:16 PM      Friday; June 10, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

    Question:-
    So I have my current [email protected] email in iChat as I thought as I had linked that to an Apple ID it was a Valid iChat Name.  It keeps coming up with a UserName or Password Invalid message.  What do I do next ?
    Answer:-
    Open iChat
    Go to the Menu under the iChat name in the Menu Bar and then Preferences and then Accounts in the new window.
    Commonly written as iChat > Preferences > Accounts as directions/actions to take.
    If it displays with a Yellow running name in the list you have a choice.
    Either register it at AIM (I would use a different password to the ISP Login) and then change the password only in iChat  (It may take you to confirm any Confirmation email from AIM first) in iChat > Preferences > Accounts
    Or you register a new Name at AIM (Or at @mac.com) and enter that (details below)
    If you have a Blue Globe name  (@mac.com) that will not Login the chances are that it the password that is the issue.
    Apple lets you create longer passwords than can be used with the AIM Servers.
    Change the Password at iForgot to no more than 16 characters.
    Then change the password in iChat as details above.
    Adding a new Account/Screen Name in iChat (that is valid with the AIM servers)
    Open iChat if not launched.
    Go to iChat Menu > Preferences > Accounts
    Click the Add ( + )  Button at the bottom of the list.
    Choose in the top item drop down either @Mac.com or AIM depending on what you registered
    Add the name (with @mac.com the software will add the @mac.com bit)
    Add in the password.  (If you don't add it now iChat will ask you each time you open it)
    Click Done.
    The Buddy List should open (New Window)
    The Accounts part of the Preferences should now have the new name and you should be looking at the details.
    You can add something in the Description line which will then title the Buddy List (Useful when you have two or more names) and make it show up as that in the iChat Menu > Accounts and the Window Menu of iChat when logged in.
    You can then highlight any other Account/Screen Name you don't want to use and use the Minus ( - ) Button to delete it.
    8:39 PM      Friday; June 10, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • HT204053 When I initially try to sign in to iCloud, I get the "Account not verified" screen and I am told to check my email for instructions to verify.  No email is ever sent. My ID and password work on all other Apple app's.  Why not for iCloud?

    When I initially try to sign in to iCloud, I get the "Account not verified" screen and I am told to check my email for instructions to verify.  No email is ever sent. My ID and password work on all other Apple app's.  Why not for iCloud?

    I've tried both. First, I tried on my pc, where iTunes had installed iCloud when it last updated. I have iTunes installed on this computer (and on my iPad and iPhone), but that wasn't the issue.
    So I went online, thinking I needed a separate iCloud Apple ID, but it prompted me for my current Apple ID and gave me the message about my ID being "valid" but not an iCloud account," which, lol, was what it had asked me to do in order to create one. I checked, and at least one other user is having the same issue. I'll attempt to copy/paste the Support request url: https://discussions.apple.com/thread/4430653?tstart=0
    Thank you for any help you can give.
    Trish

Maybe you are looking for