ORA-01729: for XMLType

Hi all,
i want to insert the xml data in my table with xmltype. At first i store these xml daten in another table as clob. But i get always the error message
ORA-01729: database link name expected
during the insert the xml data in xmltype column.
For the clobtable:
PreparedStatement pstmt_clob = con.prepareStatement("INSERT INTO clobtable VALUES(?, ?)");
pstmt_clob.setInt(1, f+1);
pstmt_clob.setCharacterStream(2, new java.io.FileReader(f_ordner[f+1]), (int)f_ordner[+1].length());
pstmt_clob.execute();
For the xmltable:
Connection conn = connect();
stmt.executeUpdate("UPDATE xmltable SET xml_dok = XMLTYPE.createXML(" + conn + "," + rs.getClob(2) + ")WHERE id =" + nr);
Code for connection:          
public Connection connect() throws Exception {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection(
"jdbc:oracle:oci:@zeus", "zhou", "diplom");
return conn;
I don't know, what's wrong with my programm. Can you help me?
thank you very much and greeting from germany
rabbit

I am not very experienced with JPA eclipselink, but I will try to answer the question since I think I know what the problem might be.
I think the problem is that you are storing the data in a String variable and sending it to the database as String(VARCHAR2). A variable of type VARCHAR2 can hold up to 4000 bytes of data (32K in PL/SQL, but this doesn't apply to you). Therefore if you try to store more than 4000 bytes you are in violation with this contract and thus ORA-01461 is thrown.
I think the right way to go is to use DirectToXMLTypeMapping. Have you tried that?
This link contains discussion that might be useful to you:
http://www.nabble.com/Oracle-XMLType,-JPA-and-EclipseLink-td19569909.html
Regarding the CHUNK size, it should be multiple of DB_BLOCK_SIZE parameter. For instance if this parameter in your database is set to 8192 (8K), then CHUNK size can be any of the following 8K, 16K, 24K and 32K (32K is the max allowed).
However, if you specify any other value for this parameter Oracle will automatically round it to the next (higher) multiple of DB_BLOCK_SIZE. In your case, if you use 8K blocks, this value will be 8192.
So there you should not be worried about this value at this point. I asked more out from curiosity.

Similar Messages

  • Error creating Streams example - ORA-01729: database link name expected

    Running 11gR1. Example from doc, "4 Single-Database Capture and Apply Example"
    the database name is "11G3". when I run the Step 3 statement below, I get the error below. What am I doing wrong? Thanks!
    DECLARE
    iscn NUMBER; -- Variable to hold instantiation SCN value
    BEGIN
    iscn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER();
    DBMS_APPLY_ADM.SET_TABLE_INSTANTIATION_SCN(
    source_object_name => 'hr.employees',
    source_database_name => '11G3',
    instantiation_scn => iscn);
    END;
    Error at line 1
    ORA-01729: database link name expected
    ORA-06512: at "SYS.DBMS_LOGREP_UTIL", line 742
    ORA-06512: at "SYS.DBMS_APPLY_ADM", line 726
    ORA-06512: at line 5

    The manual stated to be GLOBAL_NAMES compliant which means DBLINK=target DB_NAME and SID cannot start with a figure. I strongly suggest to pay a careful look to manuals as Streams has a lot of others tricks under the hat awaiting for you.

  • Persistent Layer Error Message: ORA-01729 database link name expected

    Hi,
    I've done a series of loads from DB2 into Oracle, initially importing the database objects from DB2 and Oracle, then creating the mappings, deploying and executing. It all worked and I had no problems. For some reason now whenever I tried to import a new Database Object (table) from the DB2 I enter the password, test it and it successfully connects but then I get the error message on a popup box:
    SQL Exception
    Persistent Layer Error: SQL Exception
    Class Name: CacheMediator
    Method Name: getSQLResult
    Persistent Layer Error Message: ORA-01729 database link name expected
    If I create a new location for the same database it works and I can import new objects. The only difference I can think from the initial imports is that I’ve moved the repository from one server to another. Might be the case where some information got corrupted in the metadata.
    Has anyone seen this kind of problem before? Can you please help me out with this issue?
    Thanks in advance for your help.
    Regards,
    Leo

    I found it.When I look at the db links there is something missing.When I correct it everything works fine.

  • How to create view for xmltype table in oracle

    hi:
    Can some one help me how to create view for xmltype table in oracle?
    XMLType do not have column
    Sem

    Thank you !!
    I read it and become very hard to implement what I want to do.
    Can you give me example please?
    My main goal to create view for xmltype table is to XQuery the XML data?
    Do you have any other suggestion?
    Please help
    Ali_2

  • Init.ora parameters for banking application

    hi
    i would like know guidelines for setting
    init.ora parameters for database, to handle
    load of 2 million transactions per day,with
    RAC setup for high availability.
    thanks

    You will get best practices from your production experiences and good advisors that oracle 10 has provided to you.
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14223/toc.htm

  • Setting of init.ora file for 500 users

    how to set diffrents parameters in init.ora file
    for 500 user
    (hybrid system)(oltp+dss)
    thanks

    Yeah, it depends and you will need to adjust thoses parameters during the "life" of the database.
    I give you some of my thoughts (that's just thoughts, not a rule => there is no perfect rule) :
    500 users = Unix box i guess so :
    If MTS (dont think u need MTS for 500 users) => SGA = 75% of the RAM of the server
    If NOT MTS (dedicated processes) => SGA = 50% of the RAM
    Say 2GB of RAM on no MTS :
    buffer cache = 900 MB
    shared pool = 100MB to 200 MB
    sort_area_size = 256KB
    something like 50 to 100 RBS (depends on how many users are connected simultaneously)
    for the users which will not do some OLTP operations, you should make few BIG RBS and assign their transactions to them. for thoses users, you probably need a bigger sort_area_size.
    all the tablespaces LOCALLY MANAGED
    backup with RMAN
    Fred

  • Error with VB, Ora ODBC 8.1.6, MS Tran Server and Ora services for MTS

    I am getting VB error -2147168246 "Failed to enlist global transaction" from a VB middle tier component loaded in MS Tran Server. The VB error also mentions MS OLEDB Provider, however, I am using Ora ODBC 8.1.6, MS Tran Server 2.0, Ora Services for MTS (8.1.6) and Ora 8.1.6 for Win NT database. The VB middle tier component is marked as Requires Transaction. When the error occurs, the component has performed 3 SELECT's, a DELETE FROM, 3 more SELECT's, and then fails on a 4th SELECT. All of these activities are happening in this one VB component - it is not making calls to other components. Any ideas?

    Thank you for your response. To answer your question, no, the SELECT statements do not involve any LOB's. With respect to the "Failed to enlist" error message, the dialog box mentions the Microsoft OLE DB Provider. We are using Oracle's 8.1.6 ODBC Driver and our connection string in VB 6.0 uses the DSN= syntax; we don't expicitly have the Provider= syntax in there. One of our many questions is: Given the above, is the Microsoft OLE DB Provider somehow being used, instead of Oracle's OLE DB Provider? We think not because we use Oracle Services for MTS and its trace file shows some transactions enlisted and completed, but this is a deduction - we don't really know what's happening behind the scenes. Another question we have is: When installing the Oracle 8.1.6 database on Win NT 4.0, there is a step where we must choose communication protocols. We have been selecting just TCP/IP. I read in OTN that Oracle Services for MTS talks to Microsoft's DTC using Named Pipes. We are now wondering if we should have included Named Pipes as a comm protocol when installing the DB.

  • MakeProcessingInstruction PL/SQL DOM API for XMLType

    Does anyone have a code snippet on how to use makeProcessingInstruction()(PL/SQL DOM API for XMLType)
    Description
    Casts a given DOMNode to a DOMProcessingInstruction, and returns the
    DOMProcessingInstruction.
    Syntax
    FUNCTION makeProcessingInstruction( n DOMNode)
    RETURN DOMProcessingInstruction;
    Thanks in advance

    pieter,
    I think you would want to use xmlview. A schema can be attached to the view definition, thereby creating a schema-based xmltype view.
    ie create view nameview of xmltype
    xmlschema "nameschema.xsd" ELEMENT "namehere"
    as
    select
    xmlelement ("....xmlforest(....(select xmlagg(xmlelement(....
    or something similar.
    see link for more information regarding xml views.
    http://www.vldb.org/conf/2003/papers/S30P02.pdf

  • Managed Provider Support for XmlType

    Any idea when XmlType will be supported by the managed provider?  This is the only thing preventing us from adopting it right now.
    Oracle.ManagedDataAccess.Client.OracleException: Unsupported column datatype
    Orign. link : Managed Provider Support for XmlType  (because qustion arhived)
    I am using odp.net.managed.121.1.2
    It seems that still xmlType is unsupported. It there work around?

    It appears you are using ODP.NET from ODAC 12c R2, which doesn't support XmlType. If you upgrade to ODP.NET in ODAC 12c R3, you will be able to use XmlType. It is currently supported in that version of managed ODP.NET.

  • ORA-22806 not an object or REF, Query for XMLType

    Hi,
    i am using this query :
    select centre||compte, sum(cout) from (
    SELECT o.INDICE_CENTRE as centre, substr(o.champs.extract('//compte/text()').getStringVal(),1,8)
    as compte,to_number(substr(o.champs.extract('//cout/text()').getStringVal(),1,17)) as cout
    FROM canevas o)
    group by centre||compte;
    i have got this error ORA-22806 not an object or REF.
    any sugestion please?

    Problem resolved.

  • Using isSchemaValid for xmltype

    Hello,
    I am trying to validate my xml document against the registered schema. As I have multiple schemas registered, I wanted to use isSchemaValid so that I can pass the URL of the schema I wanted to use. I receive the following error back:
    ERROR at line 48:
    ORA-06550: line 48, column 1:
    PLS-00221: 'ISSCHEMAVALID' is not a procedure or is undefined
    ORA-06550: line 48, column 1:
    I took the sample from XDB developer's guide. Here's my code:
    set serveroutput on;
    declare
    xmldoc xmltype;
    xOut varchar2(4000);
    begin
    -- populate xmldoc
    xmldoc:=xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <AttendedSchool xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.oracle.com/xsd/CRCNewLoanRequest.xsd">
         <OPEID>00234500</OPEID>
         <Student>
              <Index>
                   <SSN>123445555</SSN>
                   <BirthDate>1980-02-02</BirthDate>
                   <LastName>LITTLE</LastName>
              </Index>
              <Contacts>
                   <PermanentAddress>
                        <AddressLine>123 PARK AVE </AddressLine>
                        <City>NEW YORK</City>
                        <StateProvinceCode>NY</StateProvinceCode>
                        <PostalCode>00112</PostalCode>
                   </PermanentAddress>
              </Contacts>
              <FFELPLoanInformation LoanKey="2" Processed="N">
                   <StudentLevelCode>Second</StudentLevelCode>
                   <FinancialAwardBeginDate>2003-09-01</FinancialAwardBeginDate>
                   <FinancialAwardEndDate>2004-05-30</FinancialAwardEndDate>
                   <ProcessingTypeCode>PO</ProcessingTypeCode>
                   <FinancialAwardID>0023456000P78YREW</FinancialAwardID>
                   <EnrollmentStatusCode>FullTime</EnrollmentStatusCode>
                   <GraduationDate>2007-05-15</GraduationDate>
                   <FederalApplicationFormCode>M</FederalApplicationFormCode>
                   <PromissoryNoteDeliveryCode>Paper</PromissoryNoteDeliveryCode>
                   <Guarantor>
                        <OPEID>012</OPEID>
                   </Guarantor>
                   <SerialLoanRequestedIndicator>true</SerialLoanRequestedIndicator>
              </FFELPLoanInformation>
         </Student>
    </AttendedSchool>');
    -- validate against XML schema
    xmldoc.isSchemaValid('http://www.oracle.com/xsd/CRCNewLoanRequest.xsd');
    if xmldoc.isSchemaValid = 1 then --
         dbms_output.put_line(' Valid');
    else --
         dbms_output.put_line(' IN-Valid');
    end if;
    end;

    Guys, Thank you for your help. I tried the code given in the other reply now I receive the following error:
    "declare
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel"
    Here's the altered code:
    set serveroutput on;
    declare
    xmldoc xmltype;
    begin
    -- populate xmldoc
    xmldoc:=xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <AttendedSchool xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.oracle.com/xsd/CRCNewLoanRequest.xsd">
         <OPEID>00234500</OPEID>
         <Student>
              <Index>
                   <SSN>123445555</SSN>
                   <BirthDate>1980-02-02</BirthDate>
                   <LastName>LITTLE</LastName>
              </Index>
              <Contacts>
                   <PermanentAddress>
                        <AddressLine>123 PARK AVE </AddressLine>
                        <City>NEW YORK</City>
                        <StateProvinceCode>NY</StateProvinceCode>
                        <PostalCode>00112</PostalCode>
                   </PermanentAddress>
              </Contacts>
              <FFELPLoanInformation LoanKey="2" Processed="N">
                   <StudentLevelCode>Second</StudentLevelCode>
                   <FinancialAwardBeginDate>2003-09-01</FinancialAwardBeginDate>
                   <FinancialAwardEndDate>2004-05-30</FinancialAwardEndDate>
                   <ProcessingTypeCode>PO</ProcessingTypeCode>
                   <FinancialAwardID>0023456000P78YREW</FinancialAwardID>
                   <EnrollmentStatusCode>FullTime</EnrollmentStatusCode>
                   <GraduationDate>2007-05-15</GraduationDate>
                   <FederalApplicationFormCode>M</FederalApplicationFormCode>
                   <PromissoryNoteDeliveryCode>Paper</PromissoryNoteDeliveryCode>
                   <Guarantor>
                        <OPEID>012</OPEID>
                   </Guarantor>
                   <SerialLoanRequestedIndicator>true</SerialLoanRequestedIndicator>
              </FFELPLoanInformation>
         </Student>
    </AttendedSchool>');
    -- validate against XML schema
    if xmldoc.isSchemaValid('http://www.oracle.com/xsd/CRCNewLoanRequest.xsd')=1 then
    dbms_output.put_line(' Valid');
    else --
    dbms_output.put_line(' IN-Valid');
    end if;
    end;
    Thanks again.
    Zahida.

  • ORA-01704 inserting xmltype.

    HI.
    How can I do to make this insert works? I am getting Error SQL: ORA-01704: literal de cadena demasiado largo
    01704. 00000 -  "string literal too long"
    *Cause:    The string literal is longer than 4000 characters.
    *Action:   Use a string literal of at most 4000 characters.
               Longer values may only be entered using bind variables.
    Insert into BF_MOTORPAGOS.BF_MTP_FRA_TEMPLATEBODY (FTB_TEMPLATEBODYID,FTB_TEMPLATEREFID,FTB_TYPEFORMATID,FTB_TYPESTRUCTUREID,FTB_STRUCTUREBODY,FTB_STRUCTUREBODYXML,FTB_STATE) values ('4','2','2','7',sys.xmltype('<?xml version="1.0" encoding="ISO-8859-15"?>
    <root>
      <mapping name="estructura de encabezados" lineainicio="01" lote="05" transaccion="06" lotefin="08" lineafinal="09" nit="NitEmpresaPrincipal" identificador="NumIdCliente" fecha="fechacreacion" AGREEMENT="83" TEMPLATEREFERENCE="2" TYPEFORMAT="2"/>
      <code value="01" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="NitEmpresaPrincipal" inicio="3" fin="12" longitud="10" type="integer" requerido="1"/>
        <item name="NitEmpresaAdicional" inicio="13" fin="22" longitud="10" type="integer" requerido="0"/>
        <item name="CodEntidadFinancieraOrigen" inicio="23" fin="25" longitud="3" type="string" requerido="0"/>
        <item name="fechacreacion" inicio="26" fin="33" longitud="8" type="date" requerido="1"/>
        <item name="horagrabacion" inicio="34" fin="37" longitud="4" type="string" requerido="1"/>
        <item name="ModificadorArchivo" inicio="38" fin="38" longitud="1" type="string" requerido="1"/>
        <item name="reservado" inicio="39" fin="220" longitud="182" type="string" requerido="0"/>
      </code>
      <code value="05" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="CodServicio" inicio="3" fin="15" longitud="13" type="integer" requerido="1"/>
        <item name="NumLote" inicio="16" fin="19" longitud="4" type="integer" requerido="1"/>
        <item name="DescripcionServicio" inicio="20" fin="34" longitud="15" type="string" requerido="1"/>
        <item name="reservado" inicio="35" fin="220" longitud="186" type="string" requerido="0"/>
      </code>
      <code value="06" longitud="220" interrumpe="0">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="RefUsuario" inicio="3" fin="50" longitud="48" type="integer" requerido="1"/>
        <item name="RefSecUsuario" inicio="51" fin="80" longitud="30" type="string" requerido="0"/>
        <item name="PeriodosFacturados" inicio="81" fin="82" longitud="2" type="integer" requerido="0"/>
        <item name="Ciclo" inicio="83" fin="85" longitud="3" type="string" requerido="0"/>
        <item name="ValorServicioPrincipal" inicio="86" fin="99" longitud="14" type="integer" requerido="1"/>
        <item name="CodServFactAd" inicio="100" fin="112" longitud="13" type="string" requerido="0"/>
        <item name="VlrServAd" inicio="113" fin="126" longitud="14" type="decimal" requerido="0"/>
        <item name="fechaven" inicio="127" fin="134" longitud="8" type="date" requerido="1"/>
        <item name="idefr" inicio="135" fin="142" longitud="8" type="integer" requerido="0"/>
        <item name="NumCtaClienteReceptor" inicio="143" fin="159" longitud="17" type="string" requerido="1"/>
        <item name="TipoCtaClienteReceptor" inicio="160" fin="161" longitud="2" type="integer" requerido="0"/>
        <item name="NumIdCliente" inicio="162" fin="171" longitud="10" type="string" requerido="0"/>
        <item name="NomClteReceptor" inicio="172" fin="193" longitud="22" type="string" requerido="0"/>
        <item name="CodEntidadFinancieraOrigen" inicio="194" fin="196" longitud="3" type="integer" requerido="0"/>
        <item name="reservado" inicio="197" fin="220" longitud="24" type="string" requerido="0"/>
      </code>
      <code value="08" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="TotalRegLote" inicio="3" fin="11" longitud="9" type="integer" requerido="1"/>
        <item name="ValorServicioPrincipal" inicio="12" fin="29" longitud="18" type="decimal" requerido="1"/>
        <item name="ValorServicioAdicional" inicio="30" fin="47" longitud="18" type="decimal" requerido="0"/>
        <item name="NLote" inicio="48" fin="51" longitud="4" type="integer" requerido="1"/>
        <item name="reservado" inicio="52" fin="220" longitud="169" type="string" requerido="0"/>
      </code>
      <code value="09" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="TotalRegDetalle" inicio="3" fin="11" longitud="9" type="integer" requerido="1"/>
        <item name="TotalValorServicioPrincipal" inicio="12" fin="29" longitud="18" type="decimal" requerido="1"/>
        <item name="TotalValorServicioAdicional" inicio="30" fin="47" longitud="18" type="decimal" requerido="0"/>
        <item name="reservado" inicio="48" fin="220" longitud="173" type="string" requerido="0"/>
      </code>
    </root>')
        ,sys.xmltype('<?xml version="1.0" encoding="ISO-8859-15"?>
    <root>
      <mapping name="estructura de encabezados" lineainicio="01" lote="05" transaccion="06" lotefin="08" lineafinal="09" nit="NitEmpresaPrincipal" identificador="NumIdCliente" fecha="fechacreacion" AGREEMENT="2" TEMPLATEREFERENCE="2" TYPEFORMAT="2"/>
      <code value="01" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="NitEmpresaPrincipal" inicio="3" fin="12" longitud="10" type="integer" requerido="1"/>
        <item name="NitEmpresaAdicional" inicio="13" fin="22" longitud="10" type="integer" requerido="0"/>
        <item name="CodEntidadFinancieraOrigen" inicio="23" fin="25" longitud="3" type="string" requerido="0"/>
        <item name="fechacreacion" inicio="26" fin="33" longitud="8" type="date" requerido="1"/>
        <item name="horagrabacion" inicio="34" fin="37" longitud="4" type="string" requerido="1"/>
        <item name="ModificadorArchivo" inicio="38" fin="38" longitud="1" type="string" requerido="1"/>
        <item name="reservado" inicio="39" fin="220" longitud="182" type="string" requerido="0"/>
      </code>
      <code value="05" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="CodServicio" inicio="3" fin="15" longitud="13" type="integer" requerido="1"/>
        <item name="NumLote" inicio="16" fin="19" longitud="4" type="integer" requerido="1"/>
        <item name="DescripcionServicio" inicio="20" fin="34" longitud="15" type="string" requerido="1"/>
        <item name="reservado" inicio="35" fin="220" longitud="186" type="string" requerido="0"/>
      </code>
      <code value="06" longitud="220" interrumpe="0">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="RefUsuario" inicio="3" fin="50" longitud="48" type="integer" requerido="1"/>
        <item name="RefSecUsuario" inicio="51" fin="80" longitud="30" type="string" requerido="0"/>
        <item name="PeriodosFacturados" inicio="81" fin="82" longitud="2" type="integer" requerido="0"/>
        <item name="Ciclo" inicio="83" fin="85" longitud="3" type="string" requerido="0"/>
        <item name="ValorServicioPrincipal" inicio="86" fin="99" longitud="14" type="integer" requerido="1"/>
        <item name="CodServFactAd" inicio="100" fin="112" longitud="13" type="string" requerido="0"/>
        <item name="VlrServAd" inicio="113" fin="126" longitud="14" type="decimal" requerido="0"/>
        <item name="fechaven" inicio="127" fin="134" longitud="8" type="date" requerido="1"/>
        <item name="idefr" inicio="135" fin="142" longitud="8" type="integer" requerido="0"/>
        <item name="NumCtaClienteReceptor" inicio="143" fin="159" longitud="17" type="string" requerido="1"/>
        <item name="TipoCtaClienteReceptor" inicio="160" fin="161" longitud="2" type="integer" requerido="0"/>
        <item name="NumIdCliente" inicio="162" fin="171" longitud="10" type="string" requerido="0"/>
        <item name="NomClteReceptor" inicio="172" fin="193" longitud="22" type="string" requerido="0"/>
        <item name="CodEntidadFinancieraOrigen" inicio="194" fin="196" longitud="3" type="integer" requerido="0"/>
        <item name="reservado" inicio="197" fin="220" longitud="24" type="string" requerido="0"/>
      </code>
      <code value="08" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="TotalRegLote" inicio="3" fin="11" longitud="9" type="integer" requerido="1"/>
        <item name="ValorServicioPrincipal" inicio="12" fin="29" longitud="18" type="decimal" requerido="1"/>
        <item name="ValorServicioAdicional" inicio="30" fin="47" longitud="18" type="decimal" requerido="0"/>
        <item name="NLote" inicio="48" fin="51" longitud="4" type="integer" requerido="1"/>
        <item name="reservado" inicio="52" fin="220" longitud="169" type="string" requerido="0"/>
      </code>
      <code value="09" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="TotalRegDetalle" inicio="3" fin="11" longitud="9" type="integer" requerido="1"/>
        <item name="TotalValorServicioPrincipal" inicio="12" fin="29" longitud="18" type="decimal" requerido="1"/>
        <item name="TotalValorServicioAdicional" inicio="30" fin="47" longitud="18" type="decimal" requerido="0"/>
        <item name="reservado" inicio="48" fin="220" longitud="173" type="string" requerido="0"/>
      </code>
    </root>'),'1');

    You can either :
    1- enclose the INSERT statement in an anonymous PL/SQL block and use XMLType variables to pass XML content to the INSERT. You'll be able to use string literal up to 32767 bytes, it should be sufficient for this case.
    2- split the XML string into multiple CLOB chunks of max. 4000 bytes, e.g.
    xmltype(
    to_clob('<?xml version="1.0" encoding="ISO-8859-15"?>
    <root>
      <mapping name="estructura de encabezados" lineainicio="01" lote="05" transaccion="06" lotefin="08" lineafinal="09" nit="NitEmpresaPrincipal" identificador="NumIdCliente" fecha="fechacreacion" AGREEMENT="83" TEMPLATEREFERENCE="2" TYPEFORMAT="2"/>
      <code value="01" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="NitEmpresaPrincipal" inicio="3" fin="12" longitud="10" type="integer" requerido="1"/>
        <item name="NitEmpresaAdicional" inicio="13" fin="22" longitud="10" type="integer" requerido="0"/>
        <item name="CodEntidadFinancieraOrigen" inicio="23" fin="25" longitud="3" type="string" requerido="0"/>
        <item name="fechacreacion" inicio="26" fin="33" longitud="8" type="date" requerido="1"/>
        <item name="horagrabacion" inicio="34" fin="37" longitud="4" type="string" requerido="1"/>
        <item name="ModificadorArchivo" inicio="38" fin="38" longitud="1" type="string" requerido="1"/>
        <item name="reservado" inicio="39" fin="220" longitud="182" type="string" requerido="0"/>
      </code>
      <code value="05" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="CodServicio" inicio="3" fin="15" longitud="13" type="integer" requerido="1"/>
        <item name="NumLote" inicio="16" fin="19" longitud="4" type="integer" requerido="1"/>
        <item name="DescripcionServicio" inicio="20" fin="34" longitud="15" type="string" requerido="1"/>
        <item name="reservado" inicio="35" fin="220" longitud="186" type="string" requerido="0"/>
      </code>
      <code value="06" longitud="220" interrumpe="0">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="RefUsuario" inicio="3" fin="50" longitud="48" type="integer" requerido="1"/>
        <item name="RefSecUsuario" inicio="51" fin="80" longitud="30" type="string" requerido="0"/>
        <item name="PeriodosFacturados" inicio="81" fin="82" longitud="2" type="integer" requerido="0"/>
        <item name="Ciclo" inicio="83" fin="85" longitud="3" type="string" requerido="0"/>
        <item name="ValorServicioPrincipal" inicio="86" fin="99" longitud="14" type="integer" requerido="1"/>
        <item name="CodServFactAd" inicio="100" fin="112" longitud="13" type="string" requerido="0"/>
        <item name="VlrServAd" inicio="113" fin="126" longitud="14" type="decimal" requerido="0"/>
        <item name="fechaven" inicio="127" fin="134" longitud="8" type="date" requerido="1"/>
        <item name="idefr" inicio="135" fin="142" longitud="8" type="integer" requerido="0"/>
        <item name="NumCtaClienteReceptor" inicio="143" fin="159" longitud="17" type="string" requerido="1"/>
        <item name="TipoCtaClienteReceptor" inicio="160" fin="161" longitud="2" type="integer" requerido="0"/>
        <item name="NumIdCliente" inicio="162" fin="171" longitud="10" type="string" requerido="0"/>
        <item name="NomClteReceptor" inicio="172" fin="193" longitud="22" type="string" requerido="0"/>
        <item name="CodEntidadFinancieraOrigen" inicio="194" fin="196" longitud="3" type="integer" requerido="0"/>
        <item name="reservado" inicio="197" fin="220" longitud="24" type="string" requerido="0"/>
      </code>
      <code value="08" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="TotalRegLote" inicio="3" fin="11" longitud="9" type="integer" requerido="1"/>
        <item name="ValorServicioPrincipal" inicio="12" fin="29" longitud="18" type="decimal" requerido="1"/>
        <item name="ValorServicioAdicional" inicio="30" fin="47" longitud="18" type="decimal" requerido="0"/>
        <item name="NLote" inicio="48" fin="51" longitud="4" type="integer" requerido="1"/>
        <item name="reservado" inicio="52" fin="220" longitud="169" type="string" requerido="0"/>
      </code>') || to_clob('
      <code value="09" longitud="220" interrumpe="1">
        <item name="TipoRegistro" inicio="1" fin="2" longitud="2" type="string" requerido="1"/>
        <item name="TotalRegDetalle" inicio="3" fin="11" longitud="9" type="integer" requerido="1"/>
        <item name="TotalValorServicioPrincipal" inicio="12" fin="29" longitud="18" type="decimal" requerido="1"/>
        <item name="TotalValorServicioAdicional" inicio="30" fin="47" longitud="18" type="decimal" requerido="0"/>
        <item name="reservado" inicio="48" fin="220" longitud="173" type="string" requerido="0"/>
      </code>
    </root>')
    3- use external files :
    xmltype(bfilename('XML_DIR', 'FTB_STRUCTUREBODY.xml'), nls_charset_id('WE8ISO8859P15'))
    Option #3 would be my choice most of the time to insert large XML content.

  • How to establish a single init.ora file for 3 node RAC under ASM

    All,
    Our environment is a combination of several different memory sized SUN machines (V880, V490 & 250R).
    Setting up a single init.ora file that encompasses each of the nodes memory into the SGA sizing is our desired setup.
    Though we have established the file, the question is getting each NODE on the RAC to use that single parameter
    file to start its database instead of taking the default init.ora file in the default (asm/dbs) directory.
    As we have performed fail-over testing, upon the restart of instances they have restarted with wrong memory
    definitions that have hung the nodes when it took more memory then what was available and swap space began
    to grow.
    Steps to configure and enable this process is what I am looking for.
    Thanks
    Gerry

    Gerry,
    Here's what we do. Not sure if it is relevant to your situation ...
    (on each node)
    $ cat $ORACLE_HOME/dbs/initrac11d1.ora
    SPFILE='+DATA/rac11d/spfilerac11d.ora'
    (in ASM)
    $ asmcmd
    ASMCMD> ls -la +data/rac11d
    Type Redund Striped Time Sys Name
    Y CONTROLFILE/
    Y DATAFILE/
    Y ONLINELOG/
    Y PARAMETERFILE/
    Y TEMPFILE/
    N spfilerac11d.ora => +DATA/RAC11D/PARAMETERFILE/spfile.267.685170285
    The spfile has all parameters, qualified by node where applicable. For example :
    $ sqlplus / as sysdba
    SQL*Plus: Release 11.1.0.7.0 - Production on Wed May 6 19:00:45 2009
    Copyright (c) 1982, 2008, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
    With the Real Application Clusters option
    SQL> create pfile='/tmp/sb.ora' from spfile;
    File created.
    SQL> Disconnected from Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
    With the Real Application Clusters option
    $ cat /tmp/sb.ora
    *.archive_lag_target=1800
    *.audit_file_dest='/var/oracle/admin/rac11d/adump'
    rac11d1.dispatchers='(address=(protocol=tcp)(host=msdbc11-vip)(port=64000))'
    rac11d2.dispatchers='(address=(protocol=tcp)(host=msdbc12-vip)(port=64000))'
    *.global_names=TRUE
    rac11d1.instance_number=1
    rac11d2.instance_number=2
    rac11d1.undo_tablespace='UNDOTBS1'
    rac11d2.undo_tablespace='UNDOTBS2'
    Hope this helps,
    Steve

  • Database link from XE to 8i - Ok for XE, but error ORA-12705 for ApEx

    I have oracle 8.1.7.4 (8i) with these settings:
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    {color:#ff0000}NLS_CHARACTERSET CL8MSWIN1251{color}
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT dd-mon-rr
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZH:TZM
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZH:TZM
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    {color:#ff0000}NLS_NCHAR_CHARACTERSET CL8MSWIN1251{color}
    NLS_RDBMS_VERSION 8.1.7.4.0
    And oracle XE:
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    {color:#ff0000}NLS_CHARACTERSET AL32UTF8{color}
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    {color:#ff0000}NLS_NCHAR_CHARACTERSET AL16UTF16{color}
    NLS_RDBMS_VERSION 10.2.0.1.0
    I create database link from XE to 8i - it works fine:
    I create view in XE based on table from 8i
    and using SQL Developer {color:#0000ff}I can Select/Insert{color} into this view {color:#0000ff}from XE{color}.
    BUT when I login {color:#0000ff}to Application Express{color} and try the same SELECT from the view - {color:#0000ff}I get error:{color}
    ORA-12705: ORA-12705: invalid or unknown NLS parameter value specified
    ORA-02063: preceding line from LINKED8i
    What should I do to make Application Express work with the view based on table in remote database correctly - i.e. allow me to Select/Insert/... ?

    Hi,
    i don't have a solution for your problem but i want to share with you my research in using Database Links with XE/Apex.
    I have done it a in a lot of projects and in most of all cases it shows a strange behavior when using Database Links via Apex. As far as i know SQL-Request in Apex are executed via the DBMS_SQL-Package. And that seems to be source for all errors and strange behaviors you get.
    If you post a SQL-Request directly from your XE, everything's fine. If you do the same from APEX, sometimes it is very slow and sometimes it fails.
    So, my approach to this issue is to work with Materialized Views. Your can create MV's on your XE to reference your remote tables and even schedule refreshes. In Apex, you only work with these MV's instead of the remote tables. And everything's going to be fine!
    Hope this helps!
    Regards, Jens

  • How to deal with error ORA-06531 for collection

    All,
    Can anybody see anything wrong with my code below. As far as I can see everything is in order but I am getting the ORA-06531 error.
    Thanks in advance
    CREATE OR REPLACE
    Type T_PREO_PRIV is Object
    PRIVILEGE_ID NUMBER(10),
    PRIVILEGE_NAME VARCHAR2(20),
    PRIVILEGE_TYPE CHAR(1))
    CREATE OR REPLACE
    TYPE T_PRIVInfo IS TABLE OF PREORDER.
    T_PREO_PRIV
    SQL> CREATE OR REPLACE Procedure PREORDER.P_GetUserPrivlegetest(Userid in number, UserPriv out T_PRI
    VInfo, status out number)
    2 as
    3 V_UserPriv T_PRIVInfo;
    4 begin
    5 select T_PREO_PRIV(preo_priv.privilege_id, PRIVILEGE_NAME, PRIVILEGE_TYPE)
    6 BULK COLLECT INTO V_UserPriv
    7 from preo_user_role, preo_role_priv, preo_priv
    8 where preo_user_role.role_id = preo_role_priv.role_id
    9 and preo_role_priv.privilege_id = preo_priv.privilege_id
    10 and user_id = Userid;
    11
    12 V_UserPriv := UserPriv;
    13
    14 status := 0;
    15
    16 EXCEPTION
    17 WHEN OTHERS THEN
    18
    19 Status := -1;
    20 end;
    21 /
    Procedure created.
    SQL>
    SQL> DECLARE
    2 profile_info T_PRIVInfo;
    3 Status smallint;
    4 BEGIN
    5
    6 --preo_security.P_GetUserPrivlege(42, profile_info, status);
    7 P_GetUserPrivlegeTest(42, profile_info, status);
    8 dbms_output.put_line('P_GetUserPrivlege '||Status);
    9 For i in profile_info.FIRST..profile_info.LAST loop
    10
    11 dbms_output.put_line('******************************* ');
    12 -- dbms_output.put_line('privilege_id '||UserPriv(i).privilege_id);
    13 -- dbms_output.put_line('privilege_name '||UserPriv(i).privilege_name);
    14 -- dbms_output.put_line('privilege_type '||UserPriv(i).privilege_type);
    15 end loop;
    16
    17 END;
    18 /
    P_GetUserPrivlege -1
    DECLARE
    ERROR at line 1:
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at line 9

    As in your other post, you have these reversed. The line that says
    V_UserPriv := UserPriv;
    should be
    UserPriv := V_UserPriv;
    There may also be other errors; I didn't check.

Maybe you are looking for