inserting data in Oracle 9i XML

Hello

I want to insert xml data in a table (crmk_kplusdata).
The procedure runs without error, but no data is inserted into the table.
because the loop exits without a single iteration

My procedure is as follows...

create or replace procedure CRM_UploadKPLUS
(
v_xmlstr IN CLOB,
V_RETURNMSG OUT VARCHAR2
)
AS
XMLTYPE details;

BEGIN
Details: = xmltype.createxml (v_xmlstr);


delete from crmk_kplusdata;


for j IN
(
SELECT XMLTYPE. Extract(value (a), ' Table/Location/text()').getstringval (LIKE v_str1),)
XMLTYPE. Extract(value (a), ' Table/CountriesGrp_Id/text()').getstringval (LIKE v_str2),)
XMLTYPE. Extract(value (a), ' Table/CountriesGrp_ShortName/text()').getstringval (LIKE v_str3),)
XMLTYPE. Extract(value (a), ' Table/Countries_ShortName/text()').getstringval (LIKE v_str4),)
XMLTYPE. Extract(value (a), ' Table/LimitsTypes_ShortName/text()').getstringval (LIKE v_str5),)
XMLTYPE. Extract(value (a), ' Table/DealsGroup/text()').getstringval (LIKE v_str6),)
XMLTYPE. Extract(value (a), ' Table/KdbTables_DisplayName/text()').getstringval (LIKE v_str7),)
XMLTYPE. Extract(value (a), ' Table/DealId/text()').getstringval (LIKE v_str8),)
XMLTYPE. Extract(value (a), ' Table/TradeDate/text()').getstringval (LIKE v_str9),)
XMLTYPE. Extract(value (a), ' Table/MaturityDate/text()').getstringval (LIKE v_str10),)
XMLTYPE. Extract(value (a), ' Table/Kind/text()').getstringval (LIKE v_str11),)
XMLTYPE. Extract(value (a), ' Table/C_Cpty_ShortName/text()').getstringval (LIKE v_str12),)
XMLTYPE. Extract(value (a), ' Table/I_Cpty_ShortName/text()').getstringval (LIKE v_str13),)
XMLTYPE. Extract(value (a), ' Table/FoldersGrp_ShortName/text()').getstringval (LIKE v_str14),)
XMLTYPE. Extract(value (a), ' Table/Currencies_ShortName/text()').getstringval (LIKE v_str15),)
XMLTYPE. Extract(value (a), ' Table/F_Folders_ShortName/text()').getstringval (LIKE v_str16),)
XMLTYPE. Extract(value (a), ' Table/T_TypeOfInstr_ShortName/text()').getstringval (LIKE v_str17),)
XMLTYPE. Extract(value (a), ' Table/Cu_Currencies_ShortName/text()').getstringval (LIKE v_str18),)
XMLTYPE. Extract(value (a), ' Table/D_Amount/text()').getstringval (LIKE v_str19),)
XMLTYPE. Extract(value (a), ' Table/D_Market/text()').getstringval (LIKE v_str20),)
XMLTYPE. Extract(value (a), ' Table/D_Sensitivity/text()').getstringval (LIKE v_str21),)
XMLTYPE. Extract(value (a), ' Table/L_Amount/text()').getstringval (LIKE v_str22),)
XMLTYPE. Extract(value (a), ' Table/Column1/text()').getstringval (LIKE v_str23),)
XMLTYPE. Extract(value (a), ' Table/D_IssueToMat/text()').getstringval (LIKE v_str24),)
XMLTYPE. Extract(value (a), ' Table/D_SettlToMat/text()').getstringval (LIKE v_str25),)
XMLTYPE. Extract(value (a), ' Table/Column2/text()').getstringval (LIKE v_str26),)
XMLTYPE. Extract(value (a), ' Table/KdbTables_Id/text()').getstringval (LIKE v_str27),)
XMLTYPE. Extract(value (a), ' Table/Cpty_Id/text()').getstringval (LIKE v_str28),)
XMLTYPE. Extract(value (a), ' Table/CptyType/text()').getstringval (LIKE v_str29),)
XMLTYPE. Extract(value (a), ' Table/LegalStatus/text()').getstringval (LIKE v_str30),)
XMLTYPE. Extract(value (a), ' Table/Countries_ShortName1/text()').getstringval (LIKE v_str31),)
XMLTYPE. Extract(value (a), ' Table/Column3/text()').getstringval (LIKE v_str32),)
XMLTYPE. Extract(value (a), ' Table/Column4/text()').getstringval (LIKE v_str33),)
XMLTYPE. Extract(value (a), ' Table/Column5/text()').getstringval (AS v_str34))
TABLE
(XMLSEQUENCE(Details.EXTRACT('/NewDataSet/Table'))
) a
)
LOOP

insert into crmk_kplusdata
(
location, countriesgrp_id, countriesgrp_shortname, riskcountry,
limitstypes_shortname, dealsgroup, kdbtables_displayname,
dealid, tradedate, maturitydate, kind, c_cpty_shortname,
i_cpty_shortname, foldersgrp_shortname, lt_currencies_shortname,
f_folders_shortname, t_typeofinstr_shortname, cu_currencies_shortname,
d_amount, d_market, d_sensitivity, l_amount, exhibition, d_issuetomat,
limitsid, tableid, c_cpty_id, cptytype, d_settltomat, legalstatus,
parentcountry, ratingriskcountry, ratingparentcountry
)
values
(
j.v_str1, j.v_str2, j.v_str3, j.v_str4,
j.v_str5, j.v_str6, j.v_str7,
j.v_str8, j.v_str9, j.v_str10, j.v_str11, j.v_str12,
j.v_str13, j.v_str14, j.v_str15,
j.v_str16, j.v_str17, j.v_str18,
j.v_str19, j.v_str20, j.v_str21, j.v_str22, j.v_str23, j.v_str24, j.v_str25, j.v_str26,
j.v_str27, j.v_str28, j.v_str29, j.v_str30, j.v_str31,
j.v_str32, j.v_str33
) ;

END LOOP;
commit;

V_RETURNMSG: = 'Data inserted successfully in KPLUS DATA';

EXCEPTION WHEN OTHERS THEN
ROLLBACK;
V_RETURNMSG: = 'error in inserting DATA KPLUS' | SQLERRM;
END;


This is my XML:

< NewDataSet > < Table > < location > IB < / location > < CountriesGrp_Id > 22444 < / CountriesGrp_Id > < CountriesGrp_ShortName > IND < / CountriesGrp_ShortName > < Countries_ShortName > IND < / Countries_ShortName > < LimitsTypes_ShortName > IBANK-AGG < / LimitsTypes_ShortName > < DealsGroup > derived < / DealsGroup > < KdbTables_DisplayName > Bond Deals < / KdbTables_DisplayName > < DealId > 19873 < / DealId > < TradeDate > 2002-02-20T 10: 39:24.2860000 + 05:30 < /. TradeDate > < MaturityDate > 2012-02-20T 10: 39:24.2860000 + 05:30 < / MaturityDate > < Type > U < / friendly > < C_Cpty_ShortName > UTIBAN-MUM < / C_Cpty_ShortName > < I_Cpty_ShortName > POWER-END < / I_Cpty_ShortName > < FoldersGrp_ShortName > IBANK-ALL < / FoldersGrp_ShortName > < Currencies_ShortName > INR < / Currencies_ShortName > < F_Folders_ShortName > IBSTCSL-PS < / F_Folders_ShortName > < T_TypeOfInstr_ShortName > BNDTAX < / T_TypeOfInstr_ShortName > < Cu_Currencies_ShortName > INR < / Cu_Currencies_ShortName > < D_Amount > 50000000 < / D_Amount > < D_Market > - 58006934.2465 < / D_Market > < D_Sensitivity > 13662.277390219413 < / D_Sensitivity > < L_Amount >-50000000 < / L_Amount > < C Column1 > < / Column1 > < D_IssueToMat > 3652 < / D_IssueToMat > < D_SettlToMat > 3652 < / D_SettlToMat > < Column2 > 0 < / Column2 > < KdbTables_Id > 97 < / KdbTables_Id > < Cpty_Id > 15226 < / Cpty_Id > < CptyType > B < / CptyType > < LegalStatus > HO < / LegalStatus > < IND Countries_ShortName1 > < / Countries_ShortName1 > < Column3 > 0 < / Column3 > < column4 > 0 < / column4 > < column 5 K > < / column 5 > < / Table > < / NewDataSet >

Should be as simple as

....
INSERT INTO crmk_kplusdata
   SELECT EXTRACTVALUE (t2.COLUMN_VALUE, 'Table/Location') location,
          EXTRACTVALUE (t2.COLUMN_VALUE, 'Table/CountriesGrp_Id') countriesgrp_id,
          EXTRACTVALUE (t2.COLUMN_VALUE, 'Table/CountriesGrp_ShortName') countriesgrp_shortname,
  ........
     FROM table (
             XMLSEQUENCE (xmltype (v_xmlstr).EXTRACT ('NewDataSet/Table'))
          ) t2;
.....

Tags: Database

Similar Questions

  • Insert data into Oracle DB from MS Access Forms

    Dear professionals,
    How to insert data into the table that reside in the Oracle DB through MS Access forms?
    We have already created ODBC link tables Oracle allows you to select data, and it works.
    Unfortunately, we can select only the data, but insert, delete and update are not available via MS Access form, even if the user has all permissions on the oracle DB (grant select, insert, update, delete on oracle_table to access_user).


    driver: Microsoft ODBC for Oracle
    MS Access 2003
    Oracle DB 10.2

    THX in advance,
    Adnan

    One would need to know what means "not available". You get a specific error? As far as I know your statement is simply incorrect.
    There are perhaps incompatibilties between DLLs Microsoft and Oracle, I would avoid the Microsoft ODBC for Oracle driver like the plague!

    ---------
    Sybrand Bakker
    Senior Oracle DBA

  • Cannot insert data of type string/xml in table

    I am able to read the xml through utl_file. String, but I am not able to the same insert into the table through DBMS_XMLSTORE

    CDSL_UPLOAD is the download directory
    CDSL is the username

    PL, let myself be guided if something wrong with the following script

    SCRIPT OF THE TRIAL. XML FILE

    <? XML version = "1.0"? >
    < metadata >
    -zip codes >
    -< mappings Record = "4" >
    CA < STATE_ABBREVIATION > < / STATE_ABBREVIATION >
    < ZIPCODE > 94301 < / code >
    < / maps >
    -< mappings Record = "5" >
    < STATE_ABBREVIATION > CO < / STATE_ABBREVIATION >
    < ZIPCODE > 80323 < / code >
    < ZIP_CODE_EXTN > 9277 < / ZIP_CODE_EXTN >
    < / maps >
    < / zip codes >
    < / metadata >



    CREATE TABLE TRIALZIPCODES
    (
    STATE_ABBR VARCHAR2 (20) NOT NULL
    NUMBER ZIP_CODE (10, 0) NOT NULL
    , ZIP_CODE_EXT VARCHAR2 (20)
    );


    create or replace PROCEDURE first INSTANCE AS
    BEGIN
    DECLARE
    -declaring attributes

    charString varchar2 (80);
    finalStr varchar2 (4000): = null;
    whole rowsp;
    v_FileHandle UTL_FILE. TYPE_DE_FICHIER;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    DNAME varchar2 (20);
    Start
    dnom: = "CDSL_UPLOAD";

    -DBMS_XMLGEN.setRowTag (ctx IN ctxHandle, rowTag IN VARCHAR2);
    -DBMS_XMLGEN.setRowSetTag (ctx IN ctxHandle, rowSetTag IN VARCHAR2);
    -the name of the table specified in our DTD
    DBMS_XMLGEN. SETROWSETTAG ("l_context_handle,'s postal Code");
    -the name of the data set as shown in our DTD
    DBMS_xmlgen.setRowTag (l_context_handle, 'mappings');
    -to get the result on the screen
    dbms_output. Enable (1000000);
    -Open the XML document in read-only mode
    v_FileHandle: = utl_file.fopen (dname, 'trial.xml', 'r');

    loop

    BEGIN

    UTL_FILE.get_line (v_FileHandle, charString);
    exception
    When no_data_found then
    UTL_FILE.fclose (v_FileHandle);
    "exit";

    END;
    dbms_output.put_line (charstring);
    If finalStr is not null then
    finalStr: = finalStr | charString;
    on the other
    finalStr: = charString.
    end if;
    end loop;
    -for the insertion of XML data in the table
    insCtx: = DBMS_XMLSTORE. NEWCONTEXT('CDSL.) TRIALZIPCODES');
    insCtx: = DBMS_XMLSTORE. INSERTXML (insCtx, finalStr); --ALSO FAILED HERE
    dbms_output.put_line ('INSERT FACT' |) To_char (rowsp));
    DBMS_XMLStore.closeContext (insCtx);
    END;

    TRIAL END;

    Procedure returns the following error
    ORA-031011 XML parsing failed
    ORA-19202 error has occurred in the processing of xml
    LPX-00222 error returned to the SAX callback function
    ORA-06512 at SYS. XMLSTORE 70 line
    ORA-06512 CDSL. FIRST line 47
    ORA-06512 line 2

    PL I want to know what is the problem with the above script

    Thank you
    Vishal

    Indeed a few questions:

    (1) I don't see what possible use of this part:

    -- DBMS_XMLGEN.setRowTag ( ctx IN ctxHandle, rowTag IN VARCHAR2);
    -- DBMS_XMLGEN.setRowSetTag ( ctx IN ctxHandle, rowSetTag IN VARCHAR2);
    -- the name of the table as specified in our DTD
    DBMS_XMLGEN.SETROWSETTAG(l_context_handle,'zipcode s');
    -- the name of the data set as specified in our DTD
    DBMS_xmlgen.setRowTag(l_context_handle,'mappings') ;
    

    (2) not really a problem, but do not use UTL_FILE to read XML files. Oracle already provides the practice of methods or procedures to read XML efficiently with an call (see examples below).

    (3) in order to use the DBMS_XMLSTORE, the names of XML elements must match the columns in the table exactly, which is not the case here. If you cannot change the structure of the XML or the structure of the table to get an exact match, you can pre-process the file (with XSLT, for example).

    So, below is an example of using DBMS_XMLSTORE and an alternative with XMLTable that offers more flexibility:

    SQL> CREATE TABLE TRIALZIPCODES (
      2    STATE_ABBREVIATION VARCHAR2(20) NOT NULL
      3  , ZIPCODE NUMBER(10, 0) NOT NULL
      4  , ZIP_CODE_EXTN VARCHAR2(20)
      5  );
    
    Table created
    
    SQL> set serveroutput on
    SQL> DECLARE
      2
      3   xmldoc   clob;
      4   insCtx   DBMS_XMLStore.ctxType;
      5   dname    varchar2(20) := 'TEST_DIR';
      6   numrows  number;
      7
      8  BEGIN
      9
     10   xmldoc := dbms_xslprocessor.read2clob(dname, 'trial.xml');
     11
     12   insCtx := DBMS_XMLStore.newContext('TRIALZIPCODES');
     13   DBMS_XMLStore.setRowTag(insCtx, 'mappings');
     14   numrows := DBMS_XMLStore.insertXML(insCtx, xmldoc);
     15
     16   dbms_output.put_line('INSERT DONE '||TO_CHAR(numrows));
     17
     18   DBMS_XMLStore.closeContext(insCtx);
     19
     20  END;
     21  /
    
    INSERT DONE 2
    
    PL/SQL procedure successfully completed
    
    SQL> select * from trialzipcodes;
    
    STATE_ABBREVIATION       ZIPCODE ZIP_CODE_EXTN
    -------------------- ----------- --------------------
    CA                         94301
    CO                         80323 9277
     
    

    Or,

    SQL> select *
      2  from xmltable('/metadata/Zipcodes/mappings'
      3         passing xmltype(bfilename('TEST_DIR', 'trial.xml'), nls_charset_id('AL32UTF8'))
      4         columns state_abbr    varchar2(20) path 'STATE_ABBREVIATION'
      5               , zip_code      number(10)   path 'ZIPCODE'
      6               , zip_code_ext  varchar2(20) path 'ZIP_CODE_EXTN'
      7       )
      8  ;
    
    STATE_ABBR              ZIP_CODE ZIP_CODE_EXT
    -------------------- ----------- --------------------
    CA                         94301
    CO                         80323 9277
     
    
  • Retrieve data from oracle to XML database

    Hello

    I run a select statement on the oracle database table. It returns me the result as a table. However, I need the result as xml.
    for example
    So overall the output of a select statement, Select First_Name, Last_Name from table1 is

    First name last name
    ----------------------------------------------
    John Lewis
    David Jones

    then I need in format xml as below

    * < row >. *
    * < John first name > < / name >. *
    * < Lewis Last_Name > < / Last_Name > *.
    * < / row > *.
    * < row >. *
    * < David name > < / name >. *
    * < Jones Last_Name > < / Last_Name > *.
    * < / row > *.

    or

    * < row name = "John" Last_Name = "Lewis" / > * "
    * < row name = "David" Last_Name = 'Jones' / > * "


    In SQL Server, we use for xml auto. How can I get the xml output in oracle? Help, please.

    Thank you

    Refer to the documentation

    http://docs.Oracle.com/CD/B19306_01/AppDev.102/b14259/xdb13gen.htm

  • Insertion of dates in Oracle

    Hello. We need create a file to extract (CSV) to an Informix database to insert date/time in Oracle 10 g. For insert/update successful information, should date/time data be in a specific format? Thank you.

    Depending on how you "insert" data in Oracle you should be able to specify the format of the incoming.

    If you are using SQL * Loader or external Tables they will allow a format to be.
    If you use a different method, it could depend on, but for CSV, I would recommend external Tables.

  • Insert data as XML into the Oracle Table

    Hi all

    I have a requirement where the data in XML format, and I need to insert into the Oracle Table. For example, I get XML data in the following format,
    < results >
    < row >
    < BANK_ACCOUNT_ID > 10010 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300968 < / BANK_ID >
    Vision operations < LEGAL_ENTITY > < / LEGAL_ENTITY >
    < BANK_NAME > BofA < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 10271-17621-619 < / BANK_ACCOUNT_NUM >
    < BANK_ACCOUNT_NAME > BofA-204 < / BANK_ACCOUNT_NAME >
    < BRANCH_NAME > New York < / BRANCH_NAME >
    USD < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 09 < / BALANCE_DATE >
    < LEDGER_BALANCE > 432705900.56 < / LEDGER_BALANCE >
    < / row >
    < row >
    < BANK_ACCOUNT_ID > 10091 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300984 < / BANK_ID >
    Vision industries < LEGAL_ENTITY > < / LEGAL_ENTITY >
    Barclay Bank < BANK_NAME > < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 70986798 < / BANK_ACCOUNT_NUM >
    Bank Multi currency-626 < BANK_ACCOUNT_NAME > Barclays < / BANK_ACCOUNT_NAME >
    Reading < BRANCH_NAME > < / BRANCH_NAME >
    GBP < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 14 < / BALANCE_DATE >
    < LEDGER_BALANCE > 24244085.24 < / LEDGER_BALANCE >
    < / row >
    < row >
    < BANK_ACCOUNT_ID > 10127 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300968 < / BANK_ID >
    < LEGAL_ENTITY > SSC U.S. 01 < / LEGAL_ENTITY >
    < BANK_NAME > BofA < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 4898744 < / BANK_ACCOUNT_NUM >
    < BANK_ACCOUNT_NAME > BofA SSC U.S. 02-7188 < / BANK_ACCOUNT_NAME >
    < BRANCH_NAME > New York < / BRANCH_NAME >
    USD < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 28 < / BALANCE_DATE >
    < LEDGER_BALANCE > 10783815.28 < / LEDGER_BALANCE >
    < / row >
    < / results >

    I like to write PLSQL code that will receive these data with XML tags and insert it into the Oracle Table. Is this possible with built-in XML features provided in the Oracle database?

    Please Guide...

    Kind regards
    Priyanka

    But the problem is the file XML is to have the details of the records if you carefully observed the XML file. But by using more high statement select I get output in the following format.
    ORG_ID REQ_LINE PO_NUMBER EXPECTED_REC_QTY USER_NAME REQ_NUMBER
    204204 1444714450 11 64446445 11 OPERATIONSOPERATIONS

    The table has only one row, so you get a single row as output.
    I'm surprised that you find useful examples showing how to divide the data into several lines.

    (1) create the table with the following option, it will optimize the performance of storage and query for large XML documents:

    CREATE TABLE xxios_xml_data_test(xml_data XMLTYPE)
    XMLTYPE COLUMN xml_data STORE AS SECUREFILE BINARY XML
    ;
    

    (2) interview table with:

    SQL> select x.*
      2  from xxios_xml_data_test t
      3     , xmltable(
      4         '/Results/Row'
      5         passing t.xml_data
      6         columns ORG_ID           number       path 'ORG_ID'
      7               , REQ_NUMBER       number       path 'REQ_NUMBER'
      8               , REQ_LINE         number       path 'REQ_LINE'
      9               , PO_NUMBER        number       path 'PO_NUMBER'
     10               , EXPECTED_REC_QTY number       path 'EXPECTED_REC_QTY'
     11               , USER_NAME        varchar2(30) path 'USER_NAME'
     12       ) x
     13  ;
    
        ORG_ID REQ_NUMBER   REQ_LINE  PO_NUMBER EXPECTED_REC_QTY USER_NAME
    ---------- ---------- ---------- ---------- ---------------- ------------------------------
           204      14447          1       6444                1 OPERATIONS
           204      14450          1       6445                1 OPERATIONS
     
    
  • How to insert data in the XML file?

    Hi guys,.

    How to insert information into an XML file. I tell you, I have a CFM file with some questions to the user

    When users submit this form within the form information is send in an XML file.

    How can insert this information in the XML file?

    When I don't have a DB?

    Thank you

    Kind regards

    Fabiano Magno Pechibella

    You must

    1. Read in the XML file
    2. Analyze the document in an XML (just one big struct) object
    3. Insert your XML code of the object where you need
    4. rewrite the XML file with your data now included

    You can Google 'ColdFusion working with XML' and find hundreds of items to help you. Here's a beginning tutorial to help you get started:

    Intermediate ColdFusion Tutorials - working with XML

  • XML data to Oracle view

    Hello

    I get data from a web service via XML.

    sample of recovered data is-
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <soap:Body>
          <DocResponse xmlns="http://test.com/">
             <DocResult>
                <DocRecords>
                   <DocRecord>
                      <DocNo>5265</DocNo>
                      <DocDate>25-JAN-2011</DocDate>
                      <DocOwner>Sam</DocOwner>
                   </DocRecord>
                   <DocRecord>
                      <DocNo>7225</DocNo>
                      <DocDate>23-JAN-2011</DocDate>
                      <DocOwner>Tom</DocOwner>
                   </DocRecord>
                   <DocRecord>
                      <DocNo>5754</DocNo>
                      <DocDate>29-JAN-2011</DocDate>
                      <DocOwner>John</DocOwner>
                   </DocRecord>
                </DocRecords>
             </DocResult>
          </DocResponse>
       </soap:Body>
    </soap:Envelope>
    I need to insert data above for a normal table structured like -
    SlNo     DocNo     DocDate          DocOwner
    1     5265     25-Jan-11     Sam     
    2     7225     23-Jan-11     Tom     
    3     5754     29-Jan-11     John     
    I use-
    Oracle9i Enterprise Edition Release 9.2.0.1.0

    Help, please.

    Hello

    You can use XMLSequence, it should be available in 9.2:

    SQL> create table doc_records (
      2   slno number,
      3   docno number,
      4   docdate date,
      5   docowner varchar2(30)
      6  );
    
    Table created
    
    SQL> alter session set nls_date_language = 'english';
    
    Session altered
    
    SQL>
    SQL> DECLARE
      2
      3   v_xml_data xmltype := xmltype('
      4  
      5     
      6        
      7           
      8              
      9                 
     10                    5265
     11                    25-JAN-2011
     12                    Sam
     13                 
     14                 
     15                    7225
     16                    23-JAN-2011
     17                    Tom
     18                 
     19                 
     20                    5754
     21                    29-JAN-2011
     22                    John
     23                 
     24              
     25           
     26        
     27     
     28  ');
     29
     30  BEGIN
     31
     32   INSERT INTO doc_records (slno, docno, docdate, docowner)
     33   SELECT rownum as slno
     34        , extractValue(value(x), '/DocRecord/DocNo', 'xmlns="http://test.com/"') as docno
     35        , to_date(extractValue(value(x), '/DocRecord/DocDate', 'xmlns="http://test.com/"'), 'DD-MON-YYYY') as docdate
     36        , extractValue(value(x), '/DocRecord/DocOwner', 'xmlns="http://test.com/"') as docowner
     37   FROM TABLE(
     38          XMLSequence(
     39            Extract(
     40              v_xml_data
     41            , 'soap:Envelope/soap:Body/DocResponse/DocResult/DocRecords/DocRecord'
     42            , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/", xmlns="http://test.com/"'
     43            )
     44          )
     45        ) x
     46   ;
     47
     48  END;
     49  /
    
    PL/SQL procedure successfully completed
    
    SQL> select * from doc_records;
    
          SLNO      DOCNO DOCDATE     DOCOWNER
    ---------- ---------- ----------- ------------------------------
             1       5265 25/01/2011  Sam
             2       7225 23/01/2011  Tom
             3       5754 29/01/2011  John
    
    SQL> 
    
  • Error when trying to insert data into a database through a mediator

    I build a simple project on 11g TP$, which consists of a mediator, a file adapter, that reads an xml file and a DB adapter that inserts data in a database.
    The mediator connects to the file adapter and the DB adapter through a routing rule that it inserts the data in a table in the database.
    When I try to run this project, the input file is consumed by the adapter file, but after I get the following error



    SEVERE: Part {body} returns a null value in the message: in
    December 5, 2008 14:24:55 oracle.tip.mediator.service.transformation.XSLTransformer getPartDocument
    SEVERE: message load useful map source: {opaque=oracle.xml.parser.v2.XMLElement@19b0076}
    December 5, 2008 14:24:55 oracle.tip.mediator.service.transformation.MediatorTransformationHandler transform
    SERIOUS: Failure of Transformation
    oracle.tip.mediator.infra.exception.MediatorException: error occurred by transforming the payload!
    Please see the load XSL or source. Contact the Oracle Support if error not repairable
    at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument (XSLTransformer.java:191)
    at oracle.tip.mediator.service.transformation.XSLTransformer.transform (XSLTransformer.java:102)
    at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:103)
    at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:196)
    at oracle.tip.mediator.service.DataActionHandler.getNextPayload (DataActionHandler.java:145)
    at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:74)
    at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:53)
    at oracle.tip.mediator.service.OneWayActionHandler.oneWayRequestProcess (OneWayActionHandler.java:67)
    at oracle.tip.mediator.service.OneWayActionHandler.process (OneWayActionHandler.java:34)
    at oracle.tip.mediator.service.ActionProcessor.onMessage (ActionProcessor.java:61)
    at oracle.tip.mediator.dispatch.MessageDispatcher.executeCase (MessageDispatcher.java:103)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCase (InitialMessageDispatcher.java:465)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:361)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:254)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.dispatch (InitialMessageDispatcher.java:149)
    at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process (MediatorServiceEngine.java:533)
    at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post (MediatorServiceEngine.java:634)
    at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:138)
    at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:152)
    at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:159)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
    at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    to $Proxy70.post (Unknown Source)
    at oracle.integration.platform.blocks.adapter.fw.jca.mdb.AdapterServiceMDB.onMessage (AdapterServiceMDB.java:574)
    at oracle.integration.platform.blocks.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage (MessageEndpointImpl.java:295)
    at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:2127)
    at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:1719)
    at oracle.tip.adapter.file.inbound.ProcessWork.translateAndPublish(ProcessWork.java:677)
    at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:320)
    at oracle.integration.platform.blocks.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
    at oracle.integration.platform.blocks.adapter.fw.common.ThreadPool.run(ThreadPool.java:283)
    at java.lang.Thread.run(Thread.java:595)
    December 5, 2008 14:24:55 oracle.tip.mediator.serviceEngine.MediatorServiceEngine process
    GRAVE: update flaw treatment metric DMS
    December 5, 2008 14:24:55 oracle.tip.mediator.serviceEngine.MediatorServiceEngine process
    GRAVE: Got an exception: error occurred by transforming the payload!
    Please see the load XSL or source. Contact the Oracle Support if error not repairable
    oracle.tip.mediator.infra.exception.MediatorException: error occurred by transforming the payload!
    Please see the load XSL or source. Contact the Oracle Support if error not repairable
    at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument (XSLTransformer.java:191)
    at oracle.tip.mediator.service.transformation.XSLTransformer.transform (XSLTransformer.java:102)
    at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:103)
    at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:196)
    at oracle.tip.mediator.service.DataActionHandler.getNextPayload (DataActionHandler.java:145)
    at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:74)
    at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:53)
    at oracle.tip.mediator.service.OneWayActionHandler.oneWayRequestProcess (OneWayActionHandler.java:67)
    at oracle.tip.mediator.service.OneWayActionHandler.process (OneWayActionHandler.java:34)
    at oracle.tip.mediator.service.ActionProcessor.onMessage (ActionProcessor.java:61)
    at oracle.tip.mediator.dispatch.MessageDispatcher.executeCase (MessageDispatcher.java:103)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCase (InitialMessageDispatcher.java:465)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:361)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:254)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.dispatch (InitialMessageDispatcher.java:149)
    at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process (MediatorServiceEngine.java:533)
    at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post (MediatorServiceEngine.java:634)
    at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:138)
    at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:152)
    at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:159)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
    at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    to $Proxy70.post (Unknown Source)
    at oracle.integration.platform.blocks.adapter.fw.jca.mdb.AdapterServiceMDB.onMessage (AdapterServiceMDB.java:574)
    at oracle.integration.platform.blocks.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage (MessageEndpointImpl.java:295)
    at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:2127)
    at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:1719)
    at oracle.tip.adapter.file.inbound.ProcessWork.translateAndPublish(ProcessWork.java:677)
    at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:320)
    at oracle.integration.platform.blocks.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
    at oracle.integration.platform.blocks.adapter.fw.common.ThreadPool.run(ThreadPool.java:283)
    at java.lang.Thread.run(Thread.java:595)
    December 5, 2008 14:24:55 oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl Journal
    GRAVE: JCABinding = > ReadAdapter Service read could not perform the sending of an incoming message to the composite due to: oracle.tip.mediator.infra.exception.MediatorException: error occurred by transforming the payload!
    Please see the load XSL or source. Contact the Oracle Support if error not repairable
    December 5, 2008 14:24:55 oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl Journal
    GRAVE: JCABinding = > read
    oracle.fabric.common.FabricInvocationException: oracle.tip.mediator.infra.exception.MediatorException: error occurred by transforming the payload!
    Please see the load XSL or source. Contact the Oracle Support if error not repairable
    at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process (MediatorServiceEngine.java:599)
    at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post (MediatorServiceEngine.java:634)
    at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:138)
    at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:152)
    at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:159)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
    at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    to $Proxy70.post (Unknown Source)
    at oracle.integration.platform.blocks.adapter.fw.jca.mdb.AdapterServiceMDB.onMessage (AdapterServiceMDB.java:574)
    at oracle.integration.platform.blocks.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage (MessageEndpointImpl.java:295)
    at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:2127)
    at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:1719)
    at oracle.tip.adapter.file.inbound.ProcessWork.translateAndPublish(ProcessWork.java:677)
    at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:320)
    at oracle.integration.platform.blocks.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
    at oracle.integration.platform.blocks.adapter.fw.common.ThreadPool.run(ThreadPool.java:283)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: oracle.tip.mediator.infra.exception.MediatorException: error occurred by transforming the payload!
    Please see the load XSL or source. Contact the Oracle Support if error not repairable
    at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument (XSLTransformer.java:191)
    at oracle.tip.mediator.service.transformation.XSLTransformer.transform (XSLTransformer.java:102)
    at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:103)
    at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:196)
    at oracle.tip.mediator.service.DataActionHandler.getNextPayload (DataActionHandler.java:145)
    at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:74)
    at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:53)
    at oracle.tip.mediator.service.OneWayActionHandler.oneWayRequestProcess (OneWayActionHandler.java:67)
    at oracle.tip.mediator.service.OneWayActionHandler.process (OneWayActionHandler.java:34)
    at oracle.tip.mediator.service.ActionProcessor.onMessage (ActionProcessor.java:61)
    at oracle.tip.mediator.dispatch.MessageDispatcher.executeCase (MessageDispatcher.java:103)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCase (InitialMessageDispatcher.java:465)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:361)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:254)
    at oracle.tip.mediator.dispatch.InitialMessageDispatcher.dispatch (InitialMessageDispatcher.java:149)
    at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process (MediatorServiceEngine.java:533)
    ... 24 more

    December 5, 2008 14:24:55 oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl Journal
    WARNING: JCABinding = > ReadonReject reading: the adapter resources 'file' asked a malformed incoming message processing. However, the following Service property has not been set: "rejectedMessageHandlers." Please define and redeploy the module. Will use the default rejection file://jca \Read\rejectedMessages directory at the moment.
    December 5, 2008 14:24:55 oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl Journal
    WARNING: JCABinding = > ReadonReject reading: Send incoming message invalid to the exception handler:
    December 5, 2008 14:24:55 oracle.tip.mediator.common.error.ErrorMessageEnqueuer$ EnqueuerThread run
    CRITICAL: Doesn't have a queue error message
    javax.jms.TransactionInProgressException: cannot call commit on a JMS session capable XA.
    at oracle.j2ee.ra.jms.generic.RAUtils.make(RAUtils.java:595)
    at oracle.j2ee.ra.jms.generic.RAUtils.toTransactionInProgressException(RAUtils.java:846)
    at oracle.j2ee.ra.jms.generic.RAUtils.toTransactionInProgressException(RAUtils.java:840)
    at oracle.j2ee.ra.jms.generic.SessionWrapper.commit(SessionWrapper.java:197)
    to oracle.tip.mediator.common.error.ErrorMessageEnqueuer$ EnqueuerThread.run (ErrorMessageEnqueuer.java:187)
    at java.lang.Thread.run(Thread.java:595)

    I checked the .xsd file and my xml several times and it seems that they are correct. In addition, the .xsl file is also correct.
    Does anyone have an idea of what can produce this problem?

    Thank you

    I was finally able to get my project work. Heidi - you were right, there was a problem with the XSL generated the XSL map editor.
    I'm trying to locate if this issue has already been reported, but I'm pointing out here, in case someone else has to face the same.

    The generated XSL was as follows:

    < xsl: stylesheet version = "1.0".
    xmlns:DVM = "[http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue]".
    xmlns:bpws = "[http://schemas.xmlsoap.org/ws/2003/03/business-process/]".
    xmlns:ns1 = "[http://xmlns.oracle.com/pcbpel/adapter/db/ReadEmps/Read/DB/]".
    xmlns:PLT = "[http://schemas.xmlsoap.org/ws/2003/05/partner-link/]".
    xmlns:ns0 = "[http://www.w3.org/2001/XMLSchema]."
    xmlns:HWF = "[http://xmlns.oracle.com/bpel/workflow/xpath]".
    xmlns:XP20 = "[http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20]".
    xmlns:xref = "[http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions]".
    xmlns:TNS = "[http://xmlns.oracle.com/pcbpel/adapter/file/ReadEmps/Read/Read/]".
    xmlns: xsl = "[http://www.w3.org/1999/XSL/Transform]."
    xmlns:ORA = "[http://schemas.oracle.com/xpath/extension]".
    xmlns: xsi = "[http://www.w3.org/2001/XMLSchema-instance]."
    ' xmlns:imp1 = ' [www.TargetNameSpace.com/EmpTrack |] ' http://www.targetnamespace.com/EmpTrack] * ' *.
    xmlns:top = "[http://xmlns.oracle.com/pcbpel/adapter/db/top/DB]".
    xmlns:IDs = "[http://xmlns.oracle.com/bpel/services/IdentityService/xpath]".
    xmlns:ORCL = "[http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc]".
    xmlns:MHDR = "[http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.GetRequestHeaderExtnFunction]".
    exclude-result-prefixes = "xsl plt ns0 ns1 imp1 tns superior dvm APO hwf xp20 Xref ora ID orcl mhdr" >
    < xsl: template match = "/" >
    < EmployeeTrackingCollection: top >
    < xsl: select for each * = "/ imp1:ROWSET / imp1:ROW *" >
    < EmployeeTracking: top >
    < top: locationId >
    < xsl: value-of select = "* imp1:LOCATION_ID *" / >
    < / top: locationId >
    < top: employeeId >
    < xsl: value-of select = "* imp1:EMPLOYEE_ID *" / >
    < / top: employeeId >
    < employeeX: top >
    < xsl: value-of select = "* imp1:EMPLOYEE_X *" / >
    < / high: employeeX >
    < upper: employeeY >
    < xsl: value-of select = "* imp1:EMPLOYEE_Y" * / >
    < / top: employeeY >
    < / high: EmployeeTracking >
    < / xsl: foreach >
    < / high: EmployeeTrackingCollection >
    < / xsl: template >
    < / xsl: stylesheet >

    The Xpath expression includes the "imp1:" tag to reference namespace. I tested this XSL and it did not work. However, on the removal of namespace ' imp1: ' the XPath, XSL works fine and I am able to insert into the database. "" Any appropriate driver "does not appear in the newspaper, but all lines of XML are inserted into the database.

    Heidi - do you think it is a bug?

  • Cannot use the native sequence of database to insert data through the DbAdapter

    Hello

    I use Oracle Fusion Middleware 12.1.3 (selection of pre-designed developer programs for Oracle VM VirtualBox VMs |) Oracle Technology Network). I'm trying to insert data into the Oracle database coming with the device via a DbAdapter. I want to use the native Oracle sequences for primary keys and have configured appropriatelly the DbAdapter. But in execution, I get the following exception:

    Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ('SCOTT'. "ORDERS '." (' ' ID ')

    If I configure the such DbAdapter that do not use sequences, I get the same exception. I'm missing here?

    Kind regards

    Nicolas

    Reading more carefully the exception, in the log file of the server, not just the display of messages in the console of the em, I could note that the ConnectionFactory configured on the outgoing Dbadapter connection used to access the database was incorrect. He was using JavaDb instead of Oracle that I made a mistake of copying and pasting. Correction of this error has resolved the problem.

  • Insert data into another database with a script

    Hello.

    What is the best way to insert data into one database with a script

    INSERT INTO BF_PRUEBASMTP.bf_mtp_agr_inscription (ain_agreementid, ain_customerid, ain_paymethodsid, ain_servicemoduleid, referencia)

    SELECT AAG. AAG_AGREEMENTID, ACU. ACU_CUSTOMERID, 2, 2, ins. NUMERO_REFERENCIA

    OF BF_PRUEBASMTP.bf_mtp_agr_biller ABI

    JOIN IN-HOUSE

    BF_PRUEBASMTP. BF_MTP_AGR_AGREEMENT AAG ON ABI. ABI_BILLERID = AAG. AAG_BILLERID

    INNER JOIN 'CLIENTEUNICO. ALMUERZO" ins

    ON THE AAG. AAG_AGREEMENTID = ins. CONVENIOID

    INNER JOIN BF_PRUEBASMTP.bf_mtp_agr_customer ACU

    ON ACU.acu_typedocumentid = ins. TIPO_DOCUMENTO

    AND ACU.acu_numberid = ins. NUMERO_DOCUMENTO;

    CLIENTEUNICO. INSCRIPCIONES = SELECT * DE INSCRIPCIONES - to a DIFFERENT DATABASE


    Thank you very much.

    2931095 wrote:

    If I don't have permissions to create a database link. Is there another way to do this?

    Thank you.

    link to database IS the method by which an Oracle database accesses to a different database.

    If you are the ADMINISTRATOR, you should have permission.

    If you are not the ADMINISTRATOR, you should not have permission and need to talk to the ADMINISTRATOR that is allowed.

  • Detail table data control not insert data

    Hello

    I use JDev 11.1.2.4 and fusion web application, I have 2 main table and, when I run APP module and insert data in the table in detail its registered successfully, but when I drag the VO of the data control to af:form some data and other will be null.

    Any suggestion?

    Concerning

    Finally I found the solution

    https://forums.Oracle.com/message/10493807

  • RESTful service cannot insert data using PL/SQL.

    Hi all
    Spin: stand-alone 2.01 AL on OEL 4.8 in box a. VM
    Database Oracle 10.2.0.4 with Apex 4.2.0.00.27 on OEL4.8 in the VM B box.

    Measure of oracle.example.hr performed without problem Restful services.

    Cannot insert data using AL 2.0.1 but works on 1.1.4 AL.
    who uses the following table (under scheme: scott):
     
    create table json_demo ( title varchar2(20), description varchar2(1000) ); 
    grant all on json_demo to apex_public_user; 
    and procedure (scott diagram) below:
    CREATE OR REPLACE
    PROCEDURE post(
        p_url     IN VARCHAR2,
        p_message IN VARCHAR2,
        p_response OUT VARCHAR2)
    IS
      l_end_loop BOOLEAN := false;
      l_http_req utl_http.req;
      l_http_resp utl_http.resp;
      l_buffer CLOB;
      l_data       VARCHAR2(20000);  
      C_USER_AGENT CONSTANT VARCHAR2(4000) := 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)';
    BEGIN
      -- source: http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/
      -- Ask UTL_HTTP not to raise an exception for 4xx and 5xx status codes,
      -- rather than just returning the text of the error page.
      utl_http.set_response_error_check(false);
      -- Begin the post request
      l_http_req := utl_http.begin_request (p_url, 'POST', utl_http.HTTP_VERSION_1_1);
      -- Set the HTTP request headers
      utl_http.set_header(l_http_req, 'User-Agent', C_USER_AGENT);
      utl_http.set_header(l_http_req, 'content-type', 'application/json;charset=UTF-8');
      utl_http.set_header(l_http_req, 'content-length', LENGTH(p_message));
      -- Write the data to the body of the HTTP request
      utl_http.write_text(l_http_req, p_message);
      -- Process the request and get the response.
      l_http_resp := utl_http.get_response (l_http_req);
      dbms_output.put_line ('status code: ' || l_http_resp.status_code);
      dbms_output.put_line ('reason phrase: ' || l_http_resp.reason_phrase);
      LOOP
        EXIT
      WHEN l_end_loop;
        BEGIN
          utl_http.read_line(l_http_resp, l_buffer, true);
          IF(l_buffer IS NOT NULL AND (LENGTH(l_buffer)>0)) THEN
            l_data    := l_data||l_buffer;
          END IF;
        EXCEPTION
        WHEN utl_http.end_of_body THEN
          l_end_loop := true;
        END;
      END LOOP;
      dbms_output.put_line(l_data);
      p_response:= l_data;
      -- Look for client-side error and report it.
      IF (l_http_resp.status_code >= 400) AND (l_http_resp.status_code <= 499) THEN
        dbms_output.put_line('Check the URL.');
        utl_http.end_response(l_http_resp);
        -- Look for server-side error and report it.
      elsif (l_http_resp.status_code >= 500) AND (l_http_resp.status_code <= 599) THEN
        dbms_output.put_line('Check if the Web site is up.');
        utl_http.end_response(l_http_resp);
        RETURN;
      END IF;
      utl_http.end_response (l_http_resp);
    EXCEPTION
    WHEN OTHERS THEN
      dbms_output.put_line (sqlerrm);
      raise;
    END;
    and execution in sqldeveloper 3.2.20.09 when it connects directly to box B as scott:
     
    SET serveroutput ON
    DECLARE
      l_url      VARCHAR2(200)   :='http://MY_IP:8585/apex/demo';
      l_json     VARCHAR2(20000) := '{"title":"thetitle","description":"thedescription"}';
      l_response VARCHAR2(30000);
    BEGIN
      post( p_url => l_url, p_message =>l_json, p_response => l_response);
    END;
    leading to:
     
    anonymous block completed 
    status code: 200
    reason phrase: OK 
    with data inserted. 
    Installation using 2.0.1
       Workspace : wsdemo
     RESTful Service Module:  demo/
              URI Template:      test
                    Method:  POST
               Source Type:  PL/SQL
    and execution in sqldeveloper 3.2.20.09 when it connects directly to box B as scott:
     
    SET serveroutput ON
    DECLARE
      l_url      VARCHAR2(200)   :='http://MY_IP:8585//apex/wsdemo/demo/test';
      l_json     VARCHAR2(20000) := '{"title":"thetitle","description":"thedescription"}';
      l_response VARCHAR2(30000);
    BEGIN
      post( p_url => l_url, p_message =>l_json, p_response => l_response);
    END;
    leading to:
     
    status code: 500 
    reason phrase: Internal Server Error 
    
    Listener's log: 
    Request Path passes syntax validation
    Mapping request to database pool: PoolMap [_poolName=apex, _regex=null, _workspaceIdentifier=WSDEMO, _failed=false, _lastUpdate=1364313600000, _template=/wsdemo/, _type=BASE_PATH]
    Applied database connection info
    Attempting to process with PL/SQL Gateway
    Not processed as PL/SQL Gateway request
    Attempting to process as a RESTful Service
    demo/test matches: demo/test score: 0
    Choosing: oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as current candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=2648625079503782|2797815111031405, uriTemplate=demo/test], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true]
    Determining if request can be dispatched as a Tenanted RESTful Service
    Request path has one path segment, continuing processing
    Tenant Principal already established, cannot dispatch
    Chose oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as the final candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=2648625079503782|2797815111031405, uriTemplate=demo/test], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true] for: POST demo/test
    demo/test is a public resource
    Using generator: oracle.dbtools.rt.plsql.AnonymousBlockGenerator
    Performing JDBC request as: SCOTT
    Mar 28, 2013 1:29:28 PM oracle.dbtools.common.jdbc.JDBCCallImpl execute
    INFO: Error occurred during execution of: [CALL, begin
     insert into scott.json_demo values(/*in:title*/?,/*in:description*/?);
    end;, [title, in, class oracle.dbtools.common.stmt.UnknownParameterType], [description, in, class oracle.dbtools.common.stmt.UnknownParameterType]]with values: [thetitle, thedescription]
    Mar 28, 2013 1:29:28 PM oracle.dbtools.common.jdbc.JDBCCallImpl execute
    INFO: ORA-06550: line 1, column 6:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare exit for goto if loop mod null pragma
       raise return select update while with <an identifier>
       <a double-quoted delimited-identifier> <a bind variable> <<
       close current delete fetch lock insert open rollback
       savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare end exception exit for goto if loop mod
       null pragma raise return select update while with
       <an identifier> <a double-quoted delimited-id
    
    java.sql.SQLException: ORA-06550: line 1, column 6:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare exit for goto if loop mod null pragma
       raise return select update while with <an identifier>
       <a double-quoted delimited-identifier> <a bind variable> <<
       close current delete fetch lock insert open rollback
       savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare end exception exit for goto if loop mod
       null pragma raise return select update while with
       <an identifier> <a double-quoted delimited-id
    
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
            at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
            at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:505)
            at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:223)
            at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
            at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:205)
            at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1043)
            at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1336)
            at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3612)
            at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3713)
            at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4755)
            at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1378)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at oracle.ucp.jdbc.proxy.StatementProxyFactory.invoke(StatementProxyFactory.java:242)
            at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:124)
            at oracle.ucp.jdbc.proxy.CallableStatementProxyFactory.invoke(CallableStatementProxyFactory.java:101)
            at $Proxy46.execute(Unknown Source)
            at oracle.dbtools.common.jdbc.JDBCCallImpl.execute(JDBCCallImpl.java:44)
            at oracle.dbtools.rt.plsql.AnonymousBlockGenerator.generate(AnonymousBlockGenerator.java:176)
            at oracle.dbtools.rt.resource.templates.v2.ResourceTemplatesDispatcher$HttpResourceGenerator.response(ResourceTemplatesDispatcher.java:309)
            at oracle.dbtools.rt.web.RequestDispatchers.dispatch(RequestDispatchers.java:88)
            at oracle.dbtools.rt.web.HttpEndpointBase.restfulServices(HttpEndpointBase.java:412)
            at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:162)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
            at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.doFilter(ServletAdapter.java:1059)
            at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.invokeFilterChain(ServletAdapter.java:999)
            at com.sun.grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:434)
            at oracle.dbtools.standalone.SecureServletAdapter.doService(SecureServletAdapter.java:65)
            at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:379)
            at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
            at com.sun.grizzly.tcp.http11.GrizzlyAdapterChain.service(GrizzlyAdapterChain.java:196)
            at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
            at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
            at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
            at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
            at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
            at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
            at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
            at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
            at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
            at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
            at java.lang.Thread.run(Thread.java:662)
    Error during evaluation of resource template: ORA-06550: line 1, column 6:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare exit for goto if loop mod null pragma
       raise return select update while with <an identifier>
       <a double-quoted delimited-identifier> <a bind variable> <<
       close current delete fetch lock insert open rollback
       savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare end exception exit for goto if loop mod
       null pragma raise return select update while with
       <an identifier> <a double-quoted delimited-id
    Please notify.
    Concerning
    Zack

    Zack.L wrote:
    Hi Andy,.

    Sorry, I forgot to post the Source that is used by the AL1.1.4 and the AL2.0.1.

    Source

    begin
    insert into scott.json_demo values(:title,:description);
    end;
    

    It is a failure during insertion?
    Yes, he failed in the insert using AL2.0.1.

    If the above statement produces the following error message:

    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
     
    

    That gives me to think that a character is not printable (notice how there is anything between the quotation marks - "") worked his way in your PL/SQL Manager. Note how the error is reported to correspond to a column 74 on line 2, line 2 of the block above has 58 characters, so a pure assumption somehow, there is extra space on line 2, which confuses the PL/SQL compiler, I suggest retype PL/SQL Manager manually and see if that solves the problem.

  • SOA calling a MS SQL table to insert data.

    Hello
    I configured a XA driver to insert data into the MS SQL Server table. When I execute the stream with a SOAP user interface. I was able to insert the data from MS SQL table. But in the end, the transaction is rolled back.


    I would ask you
    < soapenv:Envelope xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/' xmlns:mvn = "http://xmlns.oracle.com/MVNEIDM/MVNESelfRegistration/MVNESelfRegistration" >
    < soapenv:Header / >
    < soapenv:Body >
    < mvn:MVNESelfRegistrationRequest >
    < mvn:subscriberId > 12345 < / mvn:subscriberId >
    < mvn:Keyword > 456 < / mvn:Keyword >
    < mvn:completionDt > 2013-02-06 T 16: 24:06.952 < / mvn:completionDt >
    < mvn:expirationdt > 2013-02-06 T 16: 24:06.952 < / mvn:expirationdt >
    < / mvn:MVNESelfRegistrationRequest >
    < / soapenv:Body >
    < / soapenv:Envelope >


    Erros on SOAP UI are:

    < env:Envelope = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:env >
    < env:Header / >
    < env:Body >
    < env:Fault >
    env:Server < faultcode > < / faultcode >
    incorrect object name < faultstring > [FMWGEN] [SQLServer JDBC Driver] [SQL Server] ' dbo. SelfRegistration'. < / faultstring >
    < faultactor / >
    < detail >
    < exception / >
    < / details >
    < / env:Fault >
    < / env:Body >
    < / env:Envelope >

    The managed server log the error is


    Form weblogic server: -.
    Error committing transaction:; nested exception is: Exception [EclipseLink-4002] (Eclipse - 2.1.3.v20110304 persistence Services - r9073): org.eclipse.persistence.exceptions.DatabaseException internal Exception: weblogic.jdbc.sqlserverbase.ddc: invalid object name [FMWGEN] [SQLServer JDBC Driver] [SQL Server] ' dbo. SelfRegistration'. Error code: 208


    The process ends with an error, but why he is rolling abck the transaction at the end. The table of the object was existing in the database and I traced the table to insert the data from the input variable reception to invoke the input variable. BPEL Instance he executed until the end, but in the end, the transaction is rolled back.

    Thank you
    Newcomer Raja

    Invalid object name ' dbo. SelfRegistration'

    I'm assuming you can see a SelfRegistration table in your database... So, I guess that BOD is not the name of the diagram on the right...

  • Extract data from Oracle into excel file

    Hello

    I have a requirement where in I need to extract data from Oracle into excel file and the worksheet excel name should be 'given '.
    for example. Excel 'AR Data_DDMMYY' file name and the name of the "Data" sheet excel

    I used the UTL_FILE API to extract the data delimited by tabs that you can open in excel, but it's not exactly an excel file as the name of the worksheet is the same as the name of the file.

    I tried to use utl_file.fcopy and frename.

    Is it possible to do it using PLSQL?

    Select * from version of v$.
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    "CORE     10.2.0.5.0     Production"
    TNS for HPUX: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    Example Code:
    declare
    cursor c is
    select * from scott.emp;
    v varchar2(100);
    f utl_file.file_type;
    
    file_name varchar2(100) := 'AR Data.xls';
    dir varchar2(50) := 'CESDIR191710';
    
    --select * from dba_directories
    
    begin
    
    
    f := utl_file.fopen(dir, file_name, 'W');
    
    v := 'EMPNO'||chr(9)||'ENAME'||chr(9)||'JOB'||chr(9)||'SAL'||chr(9)||'HIREDATE'||chr(9)||'DEPTNO';
    utl_file.put_line(f, v);
    
    for i in c
    loop
    
    v := i.empno||chr(9)||i.ename||chr(9)||i.job||chr(9)||i.sal||chr(9)||i.hiredate||chr(9)||i.deptno;
    utl_file.put_line(f, v);
    
    end loop;
    utl_file.fclose(f);
    
    --utl_file.frename(dir, file_name, dir, replace(file_name, '.xls', '_')||to_char(sysdate, 'MMDDYY')||'.xls', false);
    utl_file.fcopy(dir, file_name, dir, replace(file_name, '.xls', '_')||to_char(sysdate, 'MMDDYY')||'.xls');
    
    end;
    Thank you
    Imran

    Hello

    I tried to change the .xlsx to .xls and it gives a note at the opening of the file "the file you are trying to open, abc.xls, is in a different format that it is specified by the file extension. Check that the file is not corrupted and precedes from a trusted source before you open the file. Do you want to open it now? »

    When you rename the file does not solve your problem.
    Anton Scheffer package generates a file in format xlsx Office 2010. When rename you it with the .xls extension, then Office 2010 will give you the warning that the file format does not match the extension.

    but the requirement has to generate excel 2003 file.

    The xml_spreadsheet package writes a format that was introduced with Office 2003, but you must use .xml as extension in other Office 2010 will give you the same caveat.
    To write the real xls version (binary), you can use Apache POI. You will need to import Java classes in your db and write a PL/SQL wrapper. Or you can use one of the options above, writing the output to a windows server and then use Excel to open and save in the required format.

    You must decide whether it is easier to write the binary xls format or to convince the customer to accept other formats that can be opened with Excel.

    Concerning
    Marcus

Maybe you are looking for

  • Win XP error 0 x 80246008 - specific error service 2147024891

    I have XP Home edition with service pack 3. When I try to download the updates I get error 0 x 80246008. When I go to Control Panel Services and try to start BITS, I get "Windows cannot start BITS on the local computer. For non-Microsoft service, con

  • Where's my contacts in windows live mail?

    Somehow, I went from email windows to windows live mail but my contacts did not follow.  How to bring back my contacts?

  • Help troubleshooting Stop 0 X 77

    I have a computer that has a problem with an error Stop 0 x 77 of these last. It runs Windows XP Professional version 2002 Service Pack 3. The computer is a Dell Optiplex 760, core 2 duo E8400 with 2 GB of RAM. It has 2 internal drives, a 250 GB prim

  • Could not get the email, get the error number: 0x800CCC0E, failed connection

    Receive a msg of error Outlook Express (XP) as shown.  Just started recently. Must reboot to fix, then it repeats. Any difficulty? Receiving the msg to Outlook Express error as follows: failed to connect to the server. Account: 'ted.tedramsdell', ser

  • HP mediasmart smartmenu has stopped working

    When I connect to the computer, I get the hp mediasmart smartmenu message has stopped working!  is there a solution for this problem?