VARCHAR2 (4000 tank) in AL32UTF8

Hello

I have an instance using AL32UTF8. There is a column in a table is defined as VARCHAR2 (4000 tank). I can fill a string with 4,000 characters (multi-byte language) to this column?

Thank you

>
that means that the length of VARCHAR maxiumn is 4000 BYTES, regardless of the configuration?
>
Yes - the maximum length of VARCHAR2 is 4000 bytes.

Oracle allows to specify VARCHAR2 (4000 TANK) for a base of multibyte character set, since it is legal to insert 4000 single-byte characters. But it is to make sure that you don't try to integrate more than 4000 bytes.

Tags: Database

Similar Questions

  • Problem copying 4000 characters of CLOB in VARCHAR2 (4000 TANK)

    I'm migrating data from a table where it is stored in a CLOB to another table where I said a column of VARCHAR2(4000 CHAR).

    I stated a cursor in the form:

    (a) select columna, columnb, substr(clob_column,1,4000) of...

    (b) select columna, columnb, dbms_lob.substr(clob_column,4000,1) of...

    I then loop and EXTRACT the value of substr in a variable that is declared as VARCHAR2 (4000 TANK)

    With the cursor version 'a', using the regular subtr function, I get: ORA-01461: can bind to a LONG value only for insert into a LONG column

    With the slider 'b' version, by using the dbms_lob.substr function, I get: ORA-06502: PL/SQL: digital or value error: character string buffer too small

    I use Oracle 10.2.0.4.0

    I don't know yet what to watch next?

    Machinery says:

    However, the database uses NLS_CHARACTERSET UTF8 and NLS_NCHAR_CHARACTERSET = AL16UTF16, which are multibyte so I was expecting the declared with semantic CHAR VARCHAR2 to be multibyte.

    And it is. But in Oracle SQL VARCHAR2, as I already mentioned, must not exceed 4000 bytes. So even if you have declared it as 4000 characters, you'll get an error when the total length in bytes is greater than 4000. And since, according to the character set, a character can be 1 to 4 bytes, Oracle takes the best cases and allows you to declare it as max 4000 characters. How many characters will fit in eseccion is another question.

    SY.

  • string aggregation > 4000 store in varchar2 (4000)

    Dear experts,

    I'm using Oracle 11.2.0.3. I have the table such as

    ID NAME

    1 xyz

    1 abc xyz

    1 xyz abc def

    2 abc

    2 xyz nmnx

    I want to aggregate them so that I have the aggregation of the NAME by ID

    as

    1XYZ xyz abc xyz abc def
    2ABC xyz nmnx

    I was able to do this using:

    WITH t
         AS (SELECT 1 AS id, 'xyz' AS name FROM DUAL
             UNION ALL
             SELECT 1, ' xyz abc' FROM DUAL
             UNION ALL
             SELECT 1, 'xyz abc  def' FROM DUAL
             UNION ALL
             SELECT 2, 'abc' FROM DUAL
             UNION ALL
             SELECT 2, 'xyz  nmnx' FROM DUAL)
    SELECT     id, RTRIM (XMLCAST (XMLAGG (XMLELEMENT (e, name, ' ') ORDER BY NULL) AS CLOB)) as agg_name
        FROM   t
    GROUP BY   id;
    
    

    However, if the length (agg_name) > 8 (for simplicity), then the name should be on a separate line with the same id

    1 xyz xyz

    1 abc def

    1 xyz ABC

    2 abc xyz

    2 nmnx

    token order is not important.

    Thanks for any help

    Above could be done using

    WITH t
         AS (SELECT 1 AS id, 'xyz' AS name FROM DUAL
             UNION ALL
             SELECT 1, ' xyz abc' FROM DUAL
             UNION ALL
             SELECT 1, 'xyz abc  def' FROM DUAL
             UNION ALL
             SELECT 2, 'abc' FROM DUAL
             UNION ALL
             SELECT 2, 'xyz  nmnx' FROM DUAL)
    SELECT     ID, LISTAGG (name) WITHIN GROUP (ORDER BY NULL) org_name
        FROM   (SELECT   ID,
                         name || ' ' name,
                         CEIL (SUM (len) OVER (PARTITION BY ID ORDER BY len) / 8) part,
                         len
                  FROM   (SELECT    /*distinct */  ID, x.name, LENGTH (x.name || ' ') len
                             FROM   t, XMLTABLE ('ora:tokenize(.," ")' PASSING ' ' || TRIM (name) COLUMNS name VARCHAR2 (4000) PATH '.') x
                            WHERE   x.name IS NOT NULL))
    GROUP BY   ID, part;
    
  • Parse XML stored in portions in VARCHAR2 (4000)

    Hello

    I have to query the data to a third party application, so do not blame me for the data :-) model

    The XML is stored in a column VARCHAR2 (4000) and when there is more then 4000 characters, it is divided 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 concatenating string is too long

    SELECT  XMLTYPE(
                LISTAGG(fragment,'')
                WITHIN GROUP(ORDER BY nr))
    FROM    junk_xml
    WHERE   id = 0
    GROUP BY id;
    

    I considered also to export the data in another table using perhaps dbms_lob to concatenate the strings, but I'm not allowed to create another table.

    No idea how I can access the data hidden in this application?

    Concerning

    Marcus

    P.S.: The application is not on the treatment of the SEPA, but I don't want to show the actual data.

    Hi Marcus,

    This should work well:

    Select xmlparse (document

    (xmlcast)

    XMLAGG (XMLFOREST (fragment) nr order)

    as clob

    )

    ) as complete_doc

    of junk_xml

    where id = 0;

  • VARCHAR2 (4000) - absolute max?

    I have the following code to create a table using sqlplus.

    create table psncatsdw.acc_narrative)
    accident_num varchar2 (20).
    agency_code varchar2 (6).
    number of accident_rec_num
    VARCHAR2 (4000) narrative.
    date of input_date_time
    );


    The size in bytes max for a varchar2 is 4000. Is it possible to increase it? The "narrative" field is a field where a user basically gives his version of an accident. Recently we had a problem with that. Has never exceeded the 4000 bytes max. Some people take longer than others :) The input tool, that users have is no limit put in place to force it to keep under 4000 (and is not really practical for me to get that changed). So, when I try to load the table with data from all users, almost all of the load will fail when it reaches a 'story' longer than 4000 bytes. When I try to change the size in bytes max on the table I get predictable one error "ORA-00910: specified length too long for its data type. Is there a way hidden for me to get around this size in bytes max?


    Thank you!

    Hello

    Yes, there are way to increase it, use CLOB data type

    create table psncatsdw.acc_narrative(
    accident_num varchar2(20),
    agency_code varchar2(6),
    accident_rec_num number,
    narrative clob default empty_clob(),
    input_date_time date
    );
    

    Concerning

  • I have the blob column in a table. I want to break up the value of the column in characters varchar2 (4000) (block).

    Example of

    create table test (id primary number, data key blob);

    I want to display like

    Select code, data of the test;

    ID data

    1 character 4000

    1 character 4000

    1 character 4000

    .

    .

    and soon.

    Please help me on this

    BLOB stores binary data. What is the point of converted them to a varchar2? If the LOB will store the character data, then the appropriate data type would be CLOB. Said that, assuming that you will use CLOB here is the answer to your question.

    drop table temp purge;

    create table temp

    (

    integer ID

    clob c_lob

    );

    declare

    CLOB var;

    Start

    DBMS_LOB.CREATETEMPORARY (var, true);

    because me in 1.32 loop

    DBMS_LOB. WriteAppend (var, 1000, rpad ('x', 1000, 'x'));

    end loop;

    insert into temp (id, c_lob) values (1, var);

    insert into temp (id, c_lob) values (2, var);

    commit;

    end;

    /

    Select id

    rno

    , length (dbms_lob.substr (c_lob, 4000, offset)) c_lob_var_len

    , dbms_lob.substr (c_lob, 4000, offset) c_lob_var

    de)

    Select id

    , ((level-1) * 4000) + 1 offset

    c_lob

    level NWR

    temp

    connect

    by level<=>

    and prior id = id

    and dbms_random.value (prior) is not null

    );

  • Select the list with the list of dynamic values with more than 4000 tank of query

    Hello

    I have no application where users can store SQL queries in a CLOB column. This query is then used to populate the list, select a dynamic element through LOV. Following the code returns the query for dynamic LOV used to populate the select list. It works fine except when the length of the lv_sqlStatement becomes more than 4000 characters. Then application crashes with "ORA-06502: PL/SQL: digital or value error: character string buffer too small" when Select the list item rendering.

    Any ideas how to get around this problem? Any help is appreciated. Do not say to them to write shorter than 4000 queries because I can't (it's operational requirements).

    DECLARE
    lv_sqlStatement end_user_set.sql_statement%type;
    BEGIN
    lv_sqlStatement: =: P2_SQL_STATEMENT;
    return ' select the label, value of (' | lv_sql_statement | t ')
    To_char (t.value) if not in (select value from end_user_set_member eusm)
    where eusm. EUSRSET_ID = ' | : P2_EUSRSET_ID | ')';
    END;

    I just blogged about this problem and posted a solution. See this announcement:

    http://www.deneskubicek.blogspot.de/2013/03/select-list-with-dynamic-lov-and-Ora.html

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/Apex/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • Get the value of the question page before submitting.

    Hello all, I use the Application Express 4.2.5.00.08. I have a question on getting a value for a page element before the page is sent. I have a dynamic action:

    Action: Moving the mouse (on a region/State)

    Real Action: $('a[href*="39"]').each (function (index) {}
    lnk = $(this) .attr ('href');
    $(this) .parent)
    . Parent ('tr')
    .Attr ("href data ', lnk")
    {.mouseover (function ()}
    $(this) .css ("cursor", "pointer");
    Lrowrequired var = $(this) .closest ("tr"),.
    BLOCK = lRow.find("td[headers=BLOCK]").text ();
    $x('P39_BLOCK').value = BLOCK;
    })
    {.mouseleave (function ()}
    $(this) .css ('cursor', 'default');
    })
    });

    I am successfully able to get the value of the line while I'm hovering above the report (and P39_BLOCK is refreshing). But, in this case, the value is not set whenever it changes. My question is, if I need to use this value (say, put an another page element when P39_BLOCK is changed) without submitting the page, how is that possible?

    Kind regards
    MFadel.

    Hi Mohamed,

    That's what bothers! In my first dynamic action, I have real action 'Execute JavaScript Code', which doesn't have a property "Page items to show.". And I need this code to retrieve values from the row of the report.

    On the right, you will have the option 'page elements to present' the dynamic JavaScript actions. Only the PL/SQL. And you do not need to handle things strictly the use of javascript. JavaScript is usually used to manipulate items on the page itself, not the things on the server/session). If you need to present before your PL/SQL block, you can either use AJAX call, or you can create a dynamic action of PL/SQL that runs before your JavaScript. Put this field in the 'submit' page elements and the block of code, just put null;

    Here's a sample in javascript, ajax call. It pushes three elements of the page in the session or in the scope where APEX can access their values. You can return values through AJAX if necessary also:

    $.ajax ({type: 'POST',})

    URL: "wwv_flow.show",

    data: {}

    p_flow_id: $('#pFlowId').val (),.

    p_flow_step_id: page,.

    p_instance: $('#pInstance').val (),.

    "x 01': P39_PAGE_ITEM_1, '.

    "x 02': P39_PAGE_ITEM_2, '.

    "x 03': P39_PAGE_ITEM_3, '.

    p_request: 'APPLICATION_PROCESS = YOUR_PROCESS_NAME'

    },

    success: function (data) {}

    Console.log (Data);

    }

    });

    Then you would have a PL/SQL process called YOUR_PROCESS_NAME that can refer to variables such as

    my_var_1 VARCHAR2 (100 CHAR): = APEX_APPLICATION. G_X01; -Javascript password

    my_var_2 VARCHAR2 (100 CHAR): = APEX_APPLICATION. G_X02; -Javascript password

    my_var_3 VARCHAR2 (4000 TANK): = APEX_APPLICATION. G_X03; -Javascript password

    Can I use in my "PL/SQL procedure? Because in the end, I'm trying to use this value in a PL/SQL procedure:

    To answer your last question, Yes, you can use the P39_BLOCK in your PL/SQL, how you demonstrated above, but you must submit in the 'page' referred to submit box, otherwise it uses the last value that has been submitted.

    What I'm not clear, is do you need really value before executing the PL/SQL or you just want your PL/SQL? If you just try to pass it in PL/SQL and then just use the dynamic action of PL/SQL and pass it by using the "elements of the page to present. '' Remember, if you need a new value to publish on the page, you will need to put these fields in the box "items to display the page.

    If you only need the value of front page because you will use in javascript, somewhere, then reference it with jQuery or js and then use AJAX to continue your treatment.

    A third way, you could do, is to create a dynamic action of PL/SQL that runs before the javascript code that is null; in the body of PL/SQL, but put the P39_BLOCK in the "elements of page to submit" box. Who will just send the page element, and then take action dynamic javascript. But, I don't know why you would do that since you can't have the value submitted for javascript to use.

    Hope that all makes sense.

    Jen

  • Mapping XML-to-SQL data

    Hello

    IM only a beginner in oracle and I have recently started working with XML DB, I read on the XMLType storage models and I think that the structured storage is the best option for the project, our xml data is very structured and has a predictable structure.

    I recorded a schema in oracle (im using XE for test purposes) and run this statement:

    Start

    DBMS_XMLSCHEMA. REGISTERSCHEMA (SCHEMAURL = > 'PRODUCTOS.xsd', SCHEMADOC = > ' <? xml version = "1.0" encoding = "UTF - 8"? >)

    " < xs: Schema elementFormDefault ="qualified"xmlns: XS =" http://www.w3.org/2001/XMLSchema ">

    < xs: element name = "LISTA_PRODUCTOS" >

    < xs: complexType >

    < xs: SEQUENCE >

    < xs: element name = "PRODUCTO" maxOccurs = "unbounded" minOccurs = "1" >

    < xs: complexType >

    < xs: SEQUENCE >

    < xs: ELEMENT type = "xs: String" name = "i" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "IT" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "quantity" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "Center" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "customer" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "concepto" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "descripcionProducto" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "espacioM2" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "important" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "marca" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "medida" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "modelo" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "package" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "pesoUnitario" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "price" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "reference" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "remolque" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = 'series' > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "UM" > < / xs: element >

    < xs: ELEMENT type = "xs: String" name = "valorUnitario" > < / xs: element >

    < / xs: SEQUENCE >

    < / xs: complexType >

    < / xs: element >

    < / xs: SEQUENCE >

    < / xs: complexType >

    < / xs: element >

    < / xs: Schema > ', LOCAL = > true, GENTYPES = > true, GENBEAN = > false, GENTABLES = > true,

    FORCE = > false, OWNER = > 'TEST');

    commit;

    end;

    /

    and automatically created objects:

    LISTA_PRODUCTOS451_TAB (LISTA_PRODUCTOS448_T RELATIONAL OBJECT XMLtype STORAGE TYPE)
    DESC LISTA_PRODUCTOS448_T-> PRODUCTO (type PRODUCTO450_COLL)

    DESC PRODUCTO450_COLL-> i ' VARCHAR2 (4000 TANK), THE VARCHAR2 (4000 CHAR), quantity VARCHAR2(4000 CHAR)... valorUnitario VARCHAR2 (4000 TANK).

    If I run a select statement on LISTA_PRODUCTOS448_T (by selecting t.getClobVal () in LISTA_PRODUCTOS448_T t) I can see all the data xml, but im confused, I don't know if it is possible to run a traditional sql query and get the data as a simple recordset or if it is necessary to use the functions of XMLtype and procedures using the XPath syntax or something else. I mean why he created all of this?

    And besides I don't know how to set the size of the memory of the LISTA_PRODUCTOS451_TAB table, if I try to insert 20 xml nodes in a row, it saves all 20 nodes in a single line and if I try to save 1000 select returns an ORA-06502: digital or value error: character string buffer too small.

    Thanks in advance and sorry for my English.

    Create a temporary table (or a regular table, but you will have to do the cleaning yourself at the end of the procedure):

    create a table temporary global xmltype tmp_xml

    binary XmlType securefile XML store;

    In the SP, insert the incoming XML document.

    Purpose of test, I'll use this simplified version:

    
      
        1
        ABC
        10
        X
        1000234
      
      
        2
        ABC
        10
        Y
        1000234
      
      
        3
        DEF
        20
        Z
        1000234
      
    
    

    Then you can use XQuery to access data:

    SQL > select x.*

    tmp_xml 2 t

    3, xmltable)

    4 ' / LISTA_PRODUCTOS/PRODUCT.

    5 passage t.object_value

    path number 6 columns article 'i '.

    7 road of VARCHAR2 (3) of THIS 'it '.

    8 road number amount 'amount '.

    9 road to varchar2 (1) centro "centro".

    10 road of varchar2 (30) client 'client '.

    (11) x

    12;

    ARTICLE THIS AMOUNT CENTRO CLIENT

    ---------- --- ---------- ------ ------------------------------

    1 ABC 10 X 1000234

    2 ABC 10 Y 1000234

    3 DEF 20 Z 1000234

  • Registration of diagrams for the different storage types

    Hello

    the problem here is this:

    -There are two schemas X and Y, which, for objective reasons, need to be registered for different storage types

    -schema refers internally to the schema X

    X is saved as binary storage successfully model

    There is saved as structured storage and here, the system complains with the message:

    Error starting line: 1 at the controls.

    BEGIN

    () DBMS_XMLSCHEMA.registerSchema

    SCHEMAURL = > SYS. URIFACTORY.getURI('/rdm/rdmElement2.xsd').getURL (),

    SCHEMADOC = > SYS. URIFACTORY.getURI('/public/tech/xsd/rdm/rdmElement.xsd').getXML (),

    GENTYPES = > TRUE,

    ENABLEHIERARCHY = > DBMS_XMLSCHEMA. ENABLE_HIERARCHY_CONTENTS

    );

    END;

    Error report-

    ORA-31091: empty string specified as the name of SQL

    ORA-06512: at "XDB". DBMS_XMLSCHEMA_INT', line 55

    ORA-06512: at "XDB". DBMS_XMLSCHEMA", line 159

    ORA-06512: at line 2

    1. 31091 00000 - "string specified as a SQL name empty.

    * Cause: The XML schema document contains a SQL null name. For

    for example, the SQLName, SQLType, defaultTable attribute values.

    * Action: Make sure all objects specified SQL schema names in the

    XML schema document are valid SQL names. Otherwise, delete

    These attributes of the schema and try again.

    Is it really true that the types of storage should not be mixed? According to the docs, it shouldn't be a problem.

    Everything is fine when the two schemas are registered as the same type of storage.

    Any suggestions that might cause the problem?

    Thank you very much in advance for your help.

    To explain with a simple example, why mixed storage may not work...

    When we record a relational storage schema object, Oracle creates backstage of a set of object types and SQL collection that map XML to SQL data model structure.

    If you understand that it is also easy to understand why your scenario is not supported.

    For example, let's say that this is "schema X":

    Start

    () dbms_xmlschema.registerSchema

    schemaURL-online 'schema - X.xsd'

    schemaDoc =>

    "'http://www.w3.org/2001/XMLSchema" >

    '

    local-online true

    genTypes-online true

    );

    end;

    /

    Without annotations of schema, Oracle will create an object SQL like this (generated by the system name) type:

    CREATE OR REPLACE TYPE "DEV". ("' CommonType5101_T" AS OBJECT)

    "SYS_XDBPD$" "XDB". "' XDB$ RAW_LIST_T."

    VARCHAR2 (4000 TANK) "item1",.

    'item2' VARCHAR2 (4000 TANK)

    )

    NO FINAL CANNOT BE INSTANTIATED

    /

    Now, let's say this scheme registers Y, which uses the schema X Atapez:

    Start

    () dbms_xmlschema.registerSchema

    schemaURL-online 'schema - Y.xsd'

    schemaDoc =>

    "'http://www.w3.org/2001/XMLSchema" >

    '

    local-online true

    genTypes-online true

    );

    end;

    /

    Similarly, Oracle will create another type of SQL object:

    CREATE OR REPLACE TYPE 'Root5106_T' AS OBJECT)

    "SYS_XDBPD$" "XDB". "' XDB$ RAW_LIST_T."

    'Content' 'CommonType5101_T '.

    )

    FINAL CANNOT BE INSTANTIATED

    /

    As you can see, the type of 'root' reference the previously created type 'CommonType5101_T' when registering the schema X.

    If the schema X is registered for binary XML, no extra SQL type is created.

    Therefore, when we try to save the scheme there for the object-relational storage, Oracle will try to retrieve the name of the type that 'Content' attribute of the root must be based on, but since this type does not exist, an error is raised.

  • How to apply the procedure inside a procedure and the evils of the value in a variable?

    Hi all

    I'm usung oracle 11g.

    Here is my package and procedure

    I want to call get_email_details this procedure within the process_email_master and store the value in a variable in main proceedings

    create or replace

    PACKAGE ms_gen_process_email

    as

    type email_type is rendered (subject varchar2 (4000 tank),

    email_body varchar2 (4000 tank),

    to_receipent varchar2 (4000 tank),

    cc_receipent varchar2 (4000 char));

    type email_type_table is table of the email_type;

    procedure process_email_master)

    p_metric_name IN VARCHAR2,

    p_current_stage in varchar2,

    p_action in varchar2,

    p_pid number,

    P_OBJECT_ID in varchar2

    -p_emai_master on p_email_type_table

    );

    PROCEDURE get_email_details)

    p_metric_name IN VARCHAR2,

    p_current_stage in varchar2,

    P_ACTION in varchar2,

    p_email_type_table1 on email_type_table

    ) ;

    END ms_gen_process_email;

    ----

    create or replace

    PACKAGE ms_gen_process_email BODY

    as

    procedure process_email_master)

    p_metric_name IN VARCHAR2,

    p_current_stage in varchar2,

    p_action in varchar2,

    p_pid number,

    p_object_id in varchar2

    )

    as

    Start

    null;

    EXCEPTION

    WHILE OTHERS

    then

    null;

    end process_email_master;

    PROCEDURE get_email_details)

    p_metric_name IN VARCHAR2,

    p_current_stage IN VARCHAR2,

    P_ACTION in varchar2,

    p_email_type_table on email_type_table

    )

    as

    BEGIN

    Select the object, email_body, to_receipent, cc_receipent

    bulk collect into p_email_type_table

    of ms_gen_email_config_detail

    WHERE email_key =)

    SELECT email_key

    OF ms_gen_email_config

    WHERE metric_name = p_metric_name

    AND action p_action =

    and current_stage = p_current_stage

    );

    for me in p_email_type_table.first... loop of p_email_type_table. Last

    dbms_output.put_line (p_email_type_table (i) reserve .under | p_email_type_table (i) .email_body: p_email_type_table (i) .to_receipent: p_email_type_table (i) .cc_receipent);

    end loop;

    EXCEPTION

    WHILE OTHERS

    THEN

    NULL;

    END get_email_details;

    END ms_gen_process_email;

    but I get this error message

    Error (15,31): PLS-00201: identifier 'P_EMAIL_TYPE_TABLE' must be declared

    Concerning

    Dale

    See below the test case and change your code. You can call the procedure in detail within a main as procedure below

    CREATE or REPLACE PACKAGE test_pkg AS

    TYPE rec_val IS RECORD (empno, emp.empno%TYPE,

    Ename emp.ename%TYPE

    );

    TYPE nt_tabtest IS TABLE OF THE rec_val;

    PROCEDURE get_email_id (p_type to nt_tabtest);

    PROCEDURE get_email_master;

    END;

    /

    CREATE or REPLACE PACKAGE test_pkg BODY

    AS

    PROCEDURE get_email_id (p_type ON nt_tabtest)

    AS

    BEGIN

    SELECT EmpNo, ename COLLECT in BULK in p_type FROM emp;

    END;

    PROCEDURE get_email_master

    AS

    v_type nt_tabtest;

    BEGIN

    get_email_id (v_type);

    BECAUSE me IN v_type. FIRST... v_type. LAST

    LOOP

    DBMS_OUTPUT. Put_line (v_type (i) .empno: v_type (i) .ename);

    END LOOP;

    END;

    END;

    /

    Post edited by: 000000

  • DESC, showing the different type of data value via dblink

    Hi friends,

    We have two databases and for two of them, the configuration is as below

    Version of the operating system: Solaris 5.10

    DB version: 10.1.0.4

    For security reasons, I'm going by names of junk. Assume the names of database DB1 and DB2.

    We have a table T1 S1 schema of database DB1. to extract data from this table in DB2 in schema S2, we created a database DB1 and DB2 (lets say the name of dblink is XYZ)

    In DB1, in table T1, we have a column by name SYS_CREATED and its data type is varchar2(40 char).

    After you create the database link, below we have the table as desc

    DESC S1. T1@XYZ

    When we describe this statement, instead of showing the value of data type of column SYS_CREATED as varchar2(40 char), it's showing as varchar2(160 Char).

    Then, we created a table in DB2 under schema S2 as below

    SQL > create table S2. T2 in select * from S1. T1@XYZ;

    and now, when we describe the table T2, its original display value is varchar2 (40 Char).

    Then just when we described, it shows a higher value for the data type and when we create the table, his watch even than the original. In addition, what is happening to only varchar2 datatype. other data types such as number or tank remain same even when we describe.

    one thing is, when he demonstrated a different value using describe, sound exactly multiplying by 4 times. for example, if we have varchar2 (1000 char), the varchar2 (4000 tank) showing

    I would like to know if anyone in this strange situation earlier, if so, what is the reason?

    Thank you very much in advance

    > Unlike when you access a local object, the SELECT privilege is required to access a remote object because the database has no distance describe ability. The database must be a SELECT * on the remote object to determine its structure.

    http://docs.Oracle.com/CD/B28359_01/server.111/b28310/ds_concepts002.htm

    What happens if you give the right to select on the remote object.

    Concerning

    Girish Sharma

  • custom layout and update the page elements

    Hello

    I'm working on an APEX application, I need a page to view issues and alternative options, such as only choose radio group or mutiple shoose by box. The user will then check the answers. After the answer questions, send the page to get the score.

    The presentation must be: separate regions by the kind of question. in each region, the question in the first line; the four options in the second line, the checkbox or a radio Fund; in the bottom of the page, there is a button "submit".

    The tables are designed as follows,
    create the table RULE_QA_SHEETS
    (
    SHEET_ID NUMBER of non-null,--ID for the answer of the question sheet
    Category NUMBER not null, - use a tmplate to build the leaf, for example, numbers of gender issue, easy or difficult
    PERSON_ID NUMBER not null,-the user who was answering questions
    DATE OF ANSWER_DATE,
    NOTE VARCHAR2 (4000 TANK)
    )

    create the table RULE_QA_SHEET_ITEMS
    (
    ITEM_ID NUMBER not null,--ID for the question in this form.
    SHEET_ID NUMBER not null,--master id of the table.
    QUESTION_ID NUMBER not null,--ID for the issue in the inventory.
    MEET VARCHAR2(30 CHAR) - the answer the user checked, will be compared to the inventory. Once the user to submit the page, this column will be updated.
    )

    I've not found a good report APEX model, and I can use dynamic content plsql to generate the layout but no idea how to upgrade the right answers.

    Everyone has the same experience, or give me a help, that would be great!

    Thank you!

    Chongwu says:
    Here is the connection info.
    Workspace: CHONGWU
    User: dev1
    Password: 1qaz2wsx
    Answers and the Question of enforcement 42990

    Could you please give me an example of this? page 15, pls help to control dynamic pl/sql region that generates the page layout.

    See page 150 in your application. I started with a copy of your page 15 and brought some changes in regions of dynamic PL/SQL to produce more semantic HTML by using ordered lists and labels. Labels provide also bigger clickable/tangible goals by answering the questions.

    declare
    
      i number := 1;
    
    begin
    
      htp.p('
      '); for q in ( select q.qa_id , q.question , q.answer_a , q.answer_b , q.answer_c , q.answer_d from rule_qa q where q.question_type = 'S') loop htp.p('
    1. ' || q.question || '
        '); htp.p('
      1. ' || apex_item.radiogroup(i, 'A', null, p_item_id => 'q-' || i || '-a', p_item_label => q.answer_a) || ''); htp.p('
      2. ' || apex_item.radiogroup(i, 'B', null, p_item_id => 'q-' || i || '-b', p_item_label => q.answer_b) || ''); htp.p('
      3. ' || apex_item.radiogroup(i, 'C', null, p_item_id => 'q-' || i || '-c', p_item_label => q.answer_c) || ''); htp.p('
      4. ' || apex_item.radiogroup(i, 'D', null, p_item_id => 'q-' || i || '-d', p_item_label => q.answer_d) || ''); htp.p('
      '); i := i + 1; end loop; htp.p('
    '); end;

    Some CSS is required for formatting required and to get the labels actually appear:

    ol.questions>li {
      margin-bottom: 1em;
      font-weight: 600;
    }
    ol.answers {
      margin: 0.5em 2em;
      list-style: lower-alpha outside;
    }
      ol.answers>li {
        clear: left;
        margin: 0.5em 0;
        font-weight: 400;
      }
      ol.answers>li span {
        display: inline-block;
      }
      ol.answers>li label.hideMeButHearMe {
        position: static;
        top: auto;
      }
      ol.answers>li input {
        float: left;
        margin: 0 0.5em 0 0;
        padding: 0;
        vertical-align: middle;
      }
    

    Finally, there is a simple process that records the answers in a collection of the APEX. Collections are frequently used apps Q & A and survey to store responses temporarily before their final transformation:

    declare
    
      answer varchar2(32767);
    
    begin
    
      /*
        Create or empty the APEX collection used to temporarily store the user
        responses.
      */
      apex_collection.create_or_truncate_collection('ANSWERS');
    
      for i in 1..50
      loop
        /*
          Dynamically capture the contents of each apex_application array...
        */
        execute immediate '
            begin
              :1 := apex_util.table_to_string(apex_application.g_f' || to_char(i, 'fm09') || ');
            end;'
          using out answer;
    
        wwv_flow.debug('apex_application.g_f' || to_char(i, 'fm09') || ' = ' || answer);
    
        /*
          ...and if there's a response then record it in the collection.
        */
        if answer is not null
        then
          apex_collection.add_member(
              p_collection_name => 'ANSWERS'
            , p_n001 => i
            , p_c001 => answer);
        end if;
    
      end loop;
    
    end;
    

    It appeals to a rather horrible dynamic assessment of the apex_application tables. As Howard points out, there is only 50 of these paintings, which can be limited if you plan to have more than 50 questions. A common way to avoid these two problems is to present only one question at a time (turn-off to back on the same page in a sort of Pseudo-Assistant until all questions are answered), so you only need to refer to a single table, known.

    Note, however, that I am not keen on this model of single table. You can consider using a more flexible and extensible model as in This example.

  • WE8ISO8859P15 vs. UTF8

    Hello

    What CharSet is better to use? WE8ISO8859P15 vs. UTF8?

    We have a database of PROD which lies in WE8ISO8859P15 and we want to create a DEV database that will be the image the PROD.
    Is it possible that the DEV is in UTF8, while the PROD is WE8ISO8859P15?


    Thank you

    sybrand_b wrote:
    When you change all your own definitions of tables varchar2(.. char) and nls_lenght_semantics together in tank
    This will work as well for single-byte and multibyte character set.

    But beware: all varchar2, including varchar2 (4000 tank), is still very limited to 4000 bytes
    A character text 4000 with all characters with ISO8859 encoding above 127 does not fit into a varchar (4000 tank) UTF-8

    Also: nls_lenght_semantics only affects newly created columns, where char or byte is not specified. Nls_lenght_semantics is irrelevant once the tables are created.

  • help on concat

    Hello
    I have a table with two column col1, col2, which is of varchar2 (4000 TANK)
    I want to create a new col3 CLOB data type column and add col1 and col2 into that.

    I use

    update of tab1 set col3 = col1 | col2; - > just a sample...

    It gives me the error that there is a limit of 4,000 TANK for concat.

    Does anyone have a solution?

    Help, please.

    Thank you
    Roy

    Hello

    Something like this:

    SQL> create table tab1 as
      2  select lpad('A', 4000, 'A') col1,
      3         lpad('B', 4000, 'B') col2
      4    from dual;
    
    Table created
    SQL> alter table tab1 add (col3 clob);
    
    Table altered
    SQL> update tab1 set col3 = to_clob(col1) || to_clob(col2);
    
    1 row updated
    SQL> commit;
    
    Commit complete
    SQL> select length(col3) from tab1;
    
    LENGTH(COL3)
    ------------
            8000
    

Maybe you are looking for