How to declare the namespace of XML document to use in oracle DB?
I have an XML Schema file( 'Hospital.xsd' ) that reference the XML document ('Hospitals.xml' ).
That I use JDeveloper to build them up.
JDeveloper had set the default namespace as 'http://www.example.org'
like this :
<?xml version="1.0" encoding="UTF-8" ?>
<Hospitals xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.example.org src/Hospital.xsd"
xmlns="http://www.example.org">
If I want these two files ('Hospital.xsd' and 'Hospitals.xml') placed into
the table in the oracle database.
1. Should I create two tables? one for XSD and another for XML.
2. Should I keep the XSD file in the oracle database?
3. What is the namespace to declare in the heading of XML file?
The database name or my website URL?
Thank you very much.
Kanokporn P.
Sounds a lot like this question, only with less details.
how to read data from XML variable and insert into table variable
We can only help if you provide us details to help as we cannot see what you are doing and only know what you tell us. Plenty of examples abound on the forums that cover the topics you seek as well.
Similar Messages
-
How to read the data from XML file and insert into oracle DB
Hi All,
I have below require ment.
I will receive data in the XML file. then i need to read that data and insert into oracle tables. please let me know how this can be handled.
Many Thanks.Sounds a lot like this question, only with less details.
how to read data from XML variable and insert into table variable
We can only help if you provide us details to help as we cannot see what you are doing and only know what you tell us. Plenty of examples abound on the forums that cover the topics you seek as well. -
How to get the filters of Webi document/Report using Java code in XI SDK.
Hi All,
I have a requirement where i have to extrcat filters from the Webi Document.using java SDK.
I am trying to find the class called "filterable"but not able to use in my java code and will get always
"java.lang.ClassCastException com.businessobjects.wp.om.OMDocument cannot be cast to com.businessobjects.rebean.wi.Filterable"
I am using the below java code like
ReportElement re=document.getStructure()
FilterContainer flt=((Filterable) re).getFilter()
I am stuck and need this in uregent.
Please help.Hi Rajeev,
To retrieve a FilterContainer you will need to traverse the report structure:
ReportStructure boReportStructure = boDocumentInstance.getStructure();
ReportContainer boReportContainer = (ReportContainer) boReportStructure.getReportElement(0);
FilterContainer boFilterContainer = null;
if (boReportContainer.hasFilter()) {
boFilterContainer = boReportContainer.getFilter();
} else {
boFilterContainer = boReportContainer.createFilter(LogicalOperator.AND);
Calling boDocumentInstance.getStructure() will retrieve the entire structure for the document.
Calling boReportStructure.getReportElement(0) will retrieve the structure for the first report of the document.
Hope this helps.
Regards,
Dan -
Cannot view the content of XML document.
Hi experts,
i have saved edit form (SAP Demo News) in document folder (KM Content > document). To view the content, I click the XML document then the content is display as design in ShowForm.
My problem is i save the edit form (SAP Demo News) in my own folder (KM Content > MyFolder), then when I click the XML document the content is NOT display as design in ShowForm. But its display as XML coding.
How to make the content of XML document NOT view as XML coding?
Thanks and regards
faezaHi faeza ,
by default XML Forms can only be used in the repositories documents and userhome.
If you want to use XML-Forms in your own repository like "MyFolder" than the behaviour is like you have described.
So you have to adjust the KM settings for using XML-Forms as well in the repository "MyFolder".
Goto
System Administration ->
System Configuration ->
Knowledge Management ->
Content Management ->
Configuration
-> Content Management
-> Repository Filters
-> XML Forms Repository Filter
Choose the XML Forms Repository Filter entry "xmlforms_filter" and choose Edit.
Add as "Repositories:" your repository "MyFolder".
Save it and restart the whole portal.
Best regards
Frank -
How to insert the data from XML to a table
Hi,
I'm using Oracle 10g Express Edition
I need help in How to insert the data from XML file into the table.
Below is the example i'm working on..
I have create ridb user with below mentioned privileges:
Account Status Locked Unlocked
Default Tablespace: USERS
Temporary Tablespace: TEMP
User Privileges :
Roles:
CONNECT
RESOURCE
Direct Grant System Privileges:
CREATE DATABASE LINK
CREATE MATERIALIZED VIEW
CREATE PROCEDURE
CREATE PUBLIC SYNONYM
CREATE ROLE
CREATE SEQUENCE
CREATE SYNONYM
CREATE TABLE
CREATE TRIGGER
CREATE TYPE
CREATE VIEW
& table is created TRIALZIPCODES below mentioned is the DDL:
CREATE TABLE TRIALZIPCODES
STATE_ABBR VARCHAR2(20) NOT NULL
, ZIP_CODE NUMBER(10, 0) NOT NULL
, ZIP_CODE_EXT VARCHAR2(20)
Below is the XML FILE: which is stored in C:\OracleProject Folder
File name: trial.xml
<?xml version="1.0" ?>
<metadata>
- <Zipcodes>
- <mappings Record="4">
<STATE_ABBREVIATION>CA</STATE_ABBREVIATION>
<ZIPCODE>94301</ZIPCODE>
</mappings>
- <mappings Record="5">
<STATE_ABBREVIATION>CO</STATE_ABBREVIATION>
<ZIPCODE>80323</ZIPCODE>
<ZIP_CODE_EXTN>9277</ZIP_CODE_EXTN>
</mappings>
</Zipcodes>
</metadata>
PL/SQL Procedure:which i'm trying to execute from SQLDeveloper
create or replace
PROCEDURE TRIAL AS
BEGIN
DECLARE
-- declare attributes
charString varchar2(80);
finalStr varchar2(4000) := null;
rowsp integer;
v_FileHandle UTL_FILE.FILE_TYPE;
l_context_handle dbms_xmlgen.ctxHandle;
insCtx DBMS_XMLStore.ctxType;
begin
-- 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,'zipcodes');
-- the name of the data set as specified in our DTD
DBMS_xmlgen.setRowTag(l_context_handle,'mappings');
-- for getting the output on the screen
dbms_output.enable(1000000);
-- open the XML document in read only mode
v_FileHandle := utl_file.fopen('c:/OracleProject','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;
else
finalStr := charString;
end if;
end loop;
-- for inserting the XML data into the table
insCtx := DBMS_XMLSTORE.NEWCONTEXT('RIDB.TRIALZIPCODES');
insCtx := DBMS_XMLSTORE.INSERTXML(insCtx, finalStr);
dbms_output.put_line('INSERT DONE '||TO_CHAR(rowsp));
DBMS_XMLStore.closeContext(insCtx);
END;
END TRIAL;
For the first time when i complied i got the errors as :
Procedure RIDB.PROCEDURE1@RIDB
Error(16,14): PLS-00201: identifier 'UTL_FILE' must be declared
Error(16,14): PL/SQL: Item ignored
Error(29,1): PLS-00320: the declaration of the type of this expression is incomplete or malformed
Error(29,1): PL/SQL: Statement ignored
Error(33,1): PL/SQL: Statement ignored
Error(33,19): PLS-00320: the declaration of the type of this expression is incomplete or malformed
Error(36,1): PL/SQL: Statement ignored
Error(36,17): PLS-00320: the declaration of the type of this expression is incomplete or malformed
So i logged in as sys & grant the permission to execute on UTL_FILE to ridb (user):
SQL Statement:
grant execute on utl_file to ridb
So, it got compiled successfully but when i execute it gives me error as:
Source does not have a runnable target.
What does this mean?
So I browse through forum & i got to know that i need to initial the UTL_FILE_DIR ="C:/OracleProject" in init.ora
So can i edit the init.ora with notepad.When i tried to do that it says permission denied
In my system it shows the init.ora file in path C:\oraclexe\app\oracle\product\10.2.0\server\config\scripts
but there is also other file initXETemp in the same path do i need to do the changes in it.
I have tried even editing the SPFILE as mentioned below:
C:\oraclexe\app\oracle\product\10.2.0\server\dbs\SPFILEEXE - I had edit this file using notepad & set the value of UTL_FILE_DIR ="C:/OracleProject". So next time when i restarted i'm unable to log on to the database.
So i had reinstall the software again.
Could you please let me know how to proceed..hi,
I have created the directory from sys database
CREATE or replace DIRECTORY XML_DIR2 AS 'C:\OracleProject';
& grant read,write access to the user
grant read,write on directory XML_DIR2 to RIDB;
& i had change the tag name in the xml file as shown below:
<?xml version = '1.0'?>
<metadata>
<Zipcodes>
<mappings Record="4">
<STABBRE>CA</STABBRE>
<ZIPCODE>94301</ZIPCODE>
</mappings>
<mappings Record="5">
<STABBRE>CO</STABBRE>
<ZIPCODE>80323</ZIPCODE>
<ZIPCODEEXT>9277</ZIPCODEEXT>
</mappings>
</Zipcodes>
</metadata>
TRIALZIPCODE table as shown below:
CREATE TABLE "RIDB"."TRIALZIPCODE"
( "STABBRE" VARCHAR2(20 BYTE),
"ZIPCODE" NUMBER(*,6) NOT NULL ENABLE,
"ZIPCODEEXT" NUMBER
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS" ;
I have tried two methods as shown below:
Procedure 1:
create or replace
PROCEDURE TRIAL_V2 AS
BEGIN
DECLARE
-- declare attributes
charString varchar2(80);
finalStr varchar2(4000) := null;
rowsp integer;
v_FileHandle UTL_FILE.FILE_TYPE;
l_context_handle dbms_xmlgen.ctxHandle;
insCtx DBMS_XMLStore.ctxType;
cnt NUMBER;
xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
--XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
BEGIN
insCtx := DBMS_XMLStore.newContext('DEV.TRIALZIPCODES');
DBMS_XMLStore.setUpdateColumn(insCtx, 'STABBRE');
DBMS_XMLStore.setUpdateColumn(insCtx, 'ZIPCODE');
DBMS_XMLStore.setUpdatecolumn(insCtx, 'ZIPCODEEXT');
DBMS_XMLStore.setRowTag(insCtx, 'mappings');
cnt := DBMS_XMLStore.insertXML(insCtx, xmldoc);
DBMS_XMLStore.closeContext(insCtx);
END;
Procedure 1 was compiled with out errors but when i execute i got the error as :
Source does not have a runnable target.
Procedure 2_
CREATE OR REPLACE PROCEDURE TRIAL_V3 AS
BEGIN
DECLARE
-- declare attributes
charString varchar2(80);
finalStr varchar2(4000) := null;
rowsp integer;
v_FileHandle UTL_FILE.FILE_TYPE;
l_context_handle dbms_xmlgen.ctxHandle;
insCtx DBMS_XMLStore.ctxType;
cnt NUMBER;
xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
--XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
BEGIN
INSERT INTO trialzipcode (STABBRE, ZIPCODE, ZIPCODEEXT)
SELECT extractvalue(x.column_value, 'mappings/STABBRE'),
extractvalue(x.column_value, 'mappings/ZIPCODE'),
extractvalue(x.column_value, 'mappings/ZIPCODEEXT')
FROM TABLE(
XMLSequence(
EXTRACT(
xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') ),
'metadata/Zipcodes/mappings'
) x
END;
END TRIAL_V3;
Procedure 2 was complied without errors but when i execute i got the error as:
Connecting to the database RIDB.
ORA-22288: file or LOB operation FILEOPEN failed
The system cannot find the file specified.
ORA-06512: at "SYS.DBMS_LOB", line 523
ORA-06512: at "SYS.XMLTYPE", line 287
ORA-06512: at "RIDB.TRIAL_V3", line 12
ORA-06512: at line 2
Process exited.
Disconnecting from the database RIDB.
Could you please let me know how to proceed... -
How to check the element in xml file by xpath
hi all,
* How to check the element in xml file by xpath
for the following XML file,
* I want to check whether
the element (sage) is present or not in the following xml file XPATH expression...
* I have tried by the following expression ,
NodeList result = (NodeList) xpath.evaluate("//*:student/*:sage/text()",xml_dom,XPathConstants.STRING);
System.out.println(result.item(0).getLocalName()); * I want to get the Element sage as String value....
but i am not able to get the element,why that ??? and How to do that ???
MyXML File :
<x:student>
<x:sname>aaa</x:sname>
<x:sage>26</x:sage>
</x:student>
Thanks,
JavaImran<code>* Thanks for reply....
* </code><code>In </code>
<code>x:student element x represents the namespace...thats why i put *:student in my expression....
"//*[local-name() = 'student']/*[local-name() = 'sage']/text()"* By the above code , i am not able to get the sage as string from
</code> resul.item(0).getLocalName() method.......?
* How to get that as string format ? -
Hi Guru's,
i have a field name required date (VDATU)...
please guide me in systax how to declare the single field as globally...
thanks in advance
Srinivas...Hi all thanks for your inputs and your valube time..and finally i resoleved the issuee you can see the global declaratio in my program logic...
*& Report ZAREPAS30
REPORT zarepas30.
DATA : gs_vbeln TYPE vbak-vbeln,
gs_order_header_in TYPE bapisdhd1,
gs_order_header_inx TYPE bapisdhd1x,
gt_order_items_in TYPE STANDARD TABLE OF bapisditm,
gwa_itab1 TYPE bapisditm,
gt_order_items_inx TYPE STANDARD TABLE OF bapisditmx,
gwa_itab2 TYPE bapisditmx,
gt_order_partners TYPE STANDARD TABLE OF bapiparnr,
gwa_itab3 TYPE bapiparnr,
gt_return TYPE STANDARD TABLE OF bapiret2,
gwa_itab4 TYPE bapiret2.
Sales document type
PARAMETERS: p_auart TYPE auart OBLIGATORY.
Sales organization
PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
Distribution channel
PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
Division.
PARAMETERS: p_spart TYPE spart OBLIGATORY.
Requested Delivery Date
PARAMETERS: p_edatu TYPE edatu OBLIGATORY.
Sold-to
PARAMETERS: p_sold TYPE kunnr OBLIGATORY.
Ship-to
PARAMETERS: p_ship TYPE kunnr OBLIGATORY.
Material
PARAMETERS: p_matnr TYPE matnr OBLIGATORY.
Quantity.
PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.
Plant
PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
Start-of-selection.
START-OF-SELECTION.
Header data
Sales document type
gs_order_header_in-doc_type = p_auart.
gs_order_header_inx-doc_type = 'X'.
Sales organization
gs_order_header_in-sales_org = p_vkorg.
gs_order_header_inx-sales_org = 'X'.
Distribution channel
gs_order_header_in-distr_chan = p_vtweg.
gs_order_header_inx-distr_chan = 'X'.
Division
gs_order_header_in-division = p_spart.
gs_order_header_inx-division = 'X'.
Reguested Delivery Date
gs_order_header_in-req_date_h = p_edatu.
gs_order_header_inx-req_date_h = 'X'.
gs_order_header_inx-updateflag = 'I'.
Partner data
Sold to
gwa_itab3-partn_role = 'AG'.
gwa_itab3-partn_numb = p_sold.
APPEND gwa_itab3 TO gt_order_partners .
ship to
gwa_itab3-partn_role = 'WE'.
gwa_itab3-partn_numb = p_ship.
APPEND gwa_itab3 TO gt_order_partners .
ITEM DATA
gwa_itab2-updateflag = 'I'.
Line item number.
gwa_itab1-itm_number = '000010'.
gwa_itab2-itm_number = 'X'.
Material
gwa_itab1-material = p_matnr.
gwa_itab2-material = 'X'.
Plant
gwa_itab1-plant = p_plant.
gwa_itab2-plant = 'X'.
Quantity
gwa_itab1-target_qty = p_menge.
gwa_itab2-target_qty = 'X'.
APPEND gwa_itab1 TO gt_order_items_in.
APPEND gwa_itab2 TO gt_order_items_inx.
Line item number.
gwa_itab1-itm_number = '000020'.
gwa_itab2-itm_number = 'X'.
Material
gwa_itab1-material = p_matnr.
gwa_itab2-material = 'X'.
Plant
gwa_itab1-plant = p_plant.
gwa_itab2-plant = 'X'.
Quantity
gwa_itab1-target_qty = p_menge.
gwa_itab2-target_qty = 'X'.
APPEND gwa_itab1 TO gt_order_items_in.
APPEND gwa_itab2 TO gt_order_items_inx.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = gs_order_header_in
ORDER_HEADER_INX = gs_order_header_inx
IMPORTING
SALESDOCUMENT = gs_vbeln
tables
RETURN = gt_return
ORDER_ITEMS_IN = gt_order_items_in
ORDER_ITEMS_INX = gt_order_items_inx
order_partners = gt_order_partners.
Check the return table.
LOOP AT gt_return into gwa_itab4 WHERE type = 'E' OR type = 'A'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
WRITE: / 'Error occured while creating sales order '.
ELSE.
Commit the work.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
WRITE: / 'Document ', gs_vbeln, ' created'.
ENDIF. -
How to parse this kind of XML documents and store in a relational tables
Can u guys help me out ,..how to parse these kind of XML documents..like under PR there Sr,CreationDate and DoBID.. Again under Sr...there are LD, CID,TID, RID and so on.....
so how to parse this kind of data..how to create the structure of the table....pls help me out..
<nk8:PR>
<nk8:Sr>
<nk8:LD>---------</nk8:LID>
<nk8:CID>---------</nk8:CID>
<nk8:TID>---------</nk8:TID>
<nk8:RID>---------</nk8:RID>
<nk8:CC>OnError</nk8:CC>
<nk8:AID>---------</nk8:AID>
</nk8:Sr>
<nk8:CreationDateTime>2002-07-01</nk8:CreationDateTime>
<nk8:DOBID>---------</nk8:DOBID>
</nk8:PR>
<ssm:ER>
<ssm:PN>---------</ssm:PN>
<ssm:SN>---------</ssm:SN>
<ssm:SCt>---------</ssm:SC>
<ssm:IA>
<ssm:NT>---------</ssm:NT>
<nk8:LID>---------</nk8:LID>
<nk8:CID>---------</nk8:CID>
<ssm:AN>---------</ssm:AN>
</ssm:A>
</ssm:ER>
</nk8:PR>First, your XML document is not well formatted. Once you're done with that you can extract the values and store it in a table column.
sql> WITH xml_table AS
2 (SELECT XMLTYPE(
3 '
4 <nk8:PR xmlns:nk8="http://www.w3.org">
5 <nk8:Sr>
6 <nk8:LID>LID Value</nk8:LID>
7 <nk8:CID>CID Value</nk8:CID>
8 <nk8:TID>TID Value</nk8:TID>
9 <nk8:RID>RID Value</nk8:RID>
10 <nk8:CC>OnError</nk8:CC>
11 <nk8:AID>---------</nk8:AID>
12 </nk8:Sr>
13 </nk8:PR>') XMLCOL FROM DUAL)
14 SELECT extractvalue(t.column_value,'//nk8:LID','xmlns:nk8="http://www.w3.org"') "LID",
15 extractvalue(t.column_value,'//nk8:CID','xmlns:nk8="http://www.w3.org"') "CID",
16 extractvalue(t.column_value,'//nk8:RID','xmlns:nk8="http://www.w3.org"') "RID",
17 extractvalue(t.column_value,'//nk8:CC','xmlns:nk8="http://www.w3.org"') "CC"
18 FROM xml_table, table(xmlsequence(extract(xmlcol,'/nk8:PR/nk8:Sr','xmlns:nk8="http://www.w3.org"'))) t;
LID CID RID CC
LID Value CID Value RID Value OnError -
How do i query attributes from xml documents
I want to to query only details in Issue id="705230" (id is an attribute)
I tried this, but does not help. I should be able to query the value of core_org_id attribute
select extract(CLOB_DATA, 'PcrDocument/PcrOrganization/core_org_id) CORE_ORG_ID from from pcr_files where existsNode(CLOB_DATA, 'PcrDocument/PcrOrganization/Issues/Issue[@id="705230"]')=1;
-- does not return anything....
I tried to extract value for R_DATE & R_REVIEW_DATE for issue id=705230, but iam not able to.
Data for all the issues is retured.
Here is the query used...
select extract(CLOB_DATA, 'PcrDocument/PcrOrganization/Issues/Issue') ISSUE from pcr_files where existsNode(CLOB_DATA, 'PcrDocument/PcrOrganization/Issues/Issue[@id="705230"]')=1;
Here is the part of XML document iam querying on...
- <ns1:PcrDocument id="PCR-13562" title="EU Disclosures - EC 1060/2009" version="1" pcrPublishDate="2012-01-11T12:49:02" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://integration.mysite.com/ServiceSchema/v3">
- <ns1:PcrOrganization core_org_id="345840">
<ns1:PcrLinkedTo value="ISSUE" />
- <ns1:AdditionalInfo>
<ns1:Info type="AdditionalInfo_QuartelyReport_URL"><br></br>MGH</ns1:Info>
</ns1:AdditionalInfo>
- <ns1:Issues>
- <ns1:Issue id="705230">
- <ns1:AdditionalInfo>
<ns1:Info type="R_DATE">Credit Release Date: 09-Apr-2010</ns1:Info>
<ns1:Info type="R_REVIEW_DATE">Credit Last Review Date: 12-Oct-2011</ns1:Info>
<ns1:Info type="AdditionalInfo_QuartelyReport_URL"><br></br>MGH</ns1:Info>
</ns1:AdditionalInfo>
- <ns1:IssueDetail id="114766798">
- <ns1:AdditionalInfo>
<ns1:Info type="R_DATE">Credit Release Date: 09-Apr-2010</ns1:Info>
<ns1:Info type="R_REVIEW_DATE">Credit Last Review Date: 12-Oct-2011</ns1:Info>
<ns1:Info type="AdditionalInfo_QuartelyReport_URL"><br></br>MGH</ns1:Info>
</ns1:AdditionalInfo>
</ns1:IssueDetail>
</ns1:Issue>
- <ns1:Issue id="727193">
- <ns1:AdditionalInfo>
<ns1:Info type="R_DATE">Credit Release Date: 09-Apr-2010</ns1:Info>
<ns1:Info type="R_REVIEW_DATE">Credit Last Review Date: 12-Oct-2011</ns1:Info>
<ns1:Info type="AdditionalInfo_QuartelyReport_URL"><br></br>MGH</ns1:Info>
</ns1:AdditionalInfo>
- <ns1:IssueDetail id="117994574">
- <ns1:AdditionalInfo>
<ns1:Info type="R_DATE">Credit Release Date: 09-Apr-2010</ns1:Info>
<ns1:Info type="R_REVIEW_DATE">Credit Last Review Date: 12-Oct-2011</ns1:Info>
<ns1:Info type="AdditionalInfo_QuartelyReport_URL"><br></br>MGH</ns1:Info>
</ns1:AdditionalInfo>
</ns1:IssueDetail>
</ns1:Issue>
</ns1:Issues>
</ns1:PcrOrganization>
</ns1:PcrDocument>I did not include the name space declaration for it is working fine. Really? Then I suppose you must be using a schema-based XMLType column?
Is it Object-Relational or Binary XML storage?
You mentioned it is depricated in 11.2, but iam able to run it on 11.2.Deprecated doesn't mean it ceases functioning.
Any suggestions to covert this to XMLTable/XMLQuery format please..If you read the documentation, it covers this part too ;)
Example :
create table tmp_xml of xmltype;
insert into tmp_xml values(
xmltype('<ns1:PcrDocument id="PCR-13562" title="EU Disclosures - EC 1060/2009" version="1" pcrPublishDate="2012-01-11T12:49:02" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://integration.mysite.com/ServiceSchema/v3">
<ns1:PcrRatingDetails>
<ns1:LeadAnalyst>
<ns1:FirstName>xxxxx</ns1:FirstName>
<ns1:MiddleName/>
<ns1:LastName>xxxxxx</ns1:LastName>
<ns1:Title>Director</ns1:Title>
<ns1:Label>Primary Analyst</ns1:Label>
<ns1:Telephone>xxxxxxxxxxxx</ns1:Telephone>
<ns1:Email>[email protected]</ns1:Email>
<ns1:Address>
<ns1:Line1>Main Tower</ns1:Line1>
<ns1:Line2>Neue Mainzer Strasse</ns1:Line2>
<ns1:City>FFT</ns1:City>
<ns1:State/>
<ns1:ZipCode>99999</ns1:ZipCode>
<ns1:Country>Germany</ns1:Country>
</ns1:Address>
</ns1:LeadAnalyst>
<ns1:RatingApprover>
<ns1:FirstName>Nick</ns1:FirstName>
<ns1:MiddleName/>
<ns1:LastName>Mate</ns1:LastName>
</ns1:RatingApprover>
</ns1:PcrRatingDetails>
<ns1:PcrOrganization core_org_id="345840">
<ns1:PcrLinkedTo value="ISSUE"/>
<ns1:AdditionalInfo>
<ns1:Info type="AdditionalInfo_QuartelyReport_URL">
<br/>
<A href="http://www.mysite.com/rts/articles/en/us/?articleType=HTML&assetID=1245321070686" target="_blank">MGH</A>
</ns1:Info>
</ns1:AdditionalInfo>
<ns1:Issues>
<ns1:Issue id="705230">
<ns1:AdditionalInfo>
<ns1:Info type="R_DATE">Credit Release Date: 09-Apr-2010</ns1:Info>
<ns1:Info type="R_REVIEW_DATE">Credit Last Review Date: 12-Oct-2011</ns1:Info>
<ns1:Info type="AdditionalInfo_QuartelyReport_URL">
<br/>
<A href="http://www.mysite.com/rts/articles/en/us/?articleType=HTML&assetID=1245321070686" target="_blank">MGH</A>
</ns1:Info>
</ns1:AdditionalInfo>
<ns1:IssueDetail id="114766798">
<ns1:AdditionalInfo>
<ns1:Info type="R_DATE">Credit Release Date: 09-Apr-2010</ns1:Info>
<ns1:Info type="R_REVIEW_DATE">Credit Last Review Date: 12-Oct-2011</ns1:Info>
<ns1:Info type="AdditionalInfo_QuartelyReport_URL">
<br/>
<A href="http://www.mysite.com/rts/articles/en/us/?articleType=HTML&assetID=1245321070686" target="_blank">MGH</A>
</ns1:Info>
</ns1:AdditionalInfo>
</ns1:IssueDetail>
</ns1:Issue>
<ns1:Issue id="727193">
<ns1:AdditionalInfo>
<ns1:Info type="R_DATE">Credit Release Date: 09-Apr-2010</ns1:Info>
<ns1:Info type="R_REVIEW_DATE">Credit Last Review Date: 12-Oct-2011</ns1:Info>
<ns1:Info type="AdditionalInfo_QuartelyReport_URL">
<br/>
<A href="http://www.mysite.com/rts/articles/en/us/?articleType=HTML&assetID=1245321070686" target="_blank">MGH</A>
</ns1:Info>
</ns1:AdditionalInfo>
<ns1:IssueDetail id="117994574">
<ns1:AdditionalInfo>
<ns1:Info type="R_DATE">Credit Release Date: 09-Apr-2010</ns1:Info>
<ns1:Info type="R_REVIEW_DATE">Credit Last Review Date: 12-Oct-2011</ns1:Info>
<ns1:Info type="AdditionalInfo_QuartelyReport_URL">
<br/>
<A href="http://www.mysite.com/rts/articles/en/us/?articleType=HTML&assetID=1245321070686" target="_blank">MGH</A>
</ns1:Info>
</ns1:AdditionalInfo>
</ns1:IssueDetail>
</ns1:Issue>
</ns1:Issues>
</ns1:PcrOrganization>
</ns1:PcrDocument>')
SQL> set long 10000
SQL>
SQL> select x1.analyst
2 , x1.chair
3 , x1.core_org_id
4 , x2.*
5 from tmp_xml t
6 , xmltable(
7 xmlnamespaces(default 'http://integration.mysite.com/ServiceSchema/v3')
8 , '/PcrDocument'
9 passing t.object_value
10 columns analyst xmltype path 'PcrRatingDetails/LeadAnalyst'
11 , chair xmltype path 'PcrRatingDetails/RatingApprover'
12 , core_org_id number path 'PcrOrganization/@core_org_id'
13 , issues xmltype path 'PcrOrganization/Issues/Issue'
14 ) x1
15 , xmltable(
16 xmlnamespaces(default 'http://integration.mysite.com/ServiceSchema/v3')
17 , '/Issue'
18 passing x1.issues
19 columns issue number path '@id'
20 , rating_date varchar2(40) path 'AdditionalInfo/Info[@type="R_DATE"]'
21 , rating_review_date varchar2(40) path 'AdditionalInfo/Info[@type="R_REVIEW_DATE"]'
22 , issue_detail number path 'IssueDetail/@id'
23 , id_rating_date varchar2(40) path 'IssueDetail/AdditionalInfo/Info[@type="R_DATE"]'
24 , id_rating_review_date varchar2(40) path 'IssueDetail/AdditionalInfo/Info[@type="R_REVIEW_DATE"]'
25 ) x2
26 where x2.issue = 705230
27 ;
ANALYST CHAIR CORE_ORG_ID ISSUE RATING_DATE RATING_REVIEW_DATE ISSUE_DETAIL ID_RATING_DATE ID_RATING_REVIEW_DATE
<LeadAnalyst xmlns="http://integration.mysite.com/ServiceSchema/v3"> <RatingApprover xmlns="http://integration.mysite.com/ServiceSchema/v3"> 345840 705230 Credit Release Date: 09-Apr-2010 Credit Last Review Date: 12-Oct-2011 114766798 Credit Release Date: 09-Apr-2010 Credit Last Review Date: 12-Oct-2011
<FirstName>xxxxx</FirstName> <FirstName>Nick</FirstName>
<MiddleName/> <MiddleName/>
<LastName>xxxxxx</LastName> <LastName>Mate</LastName>
<Title>Director</Title> </RatingApprover>
<Label>Primary Analyst</Label>
<Telephone>xxxxxxxxxxxx</Telephone>
<Email>[email protected]</Email>
<Address>
<Line1>Main Tower</Line1>
<Line2>Neue Mainzer Strasse</Line2>
<City>FFT</City>
<State/>
<ZipCode>99999</ZipCode>
<Country>Germany</Country>
</Address>
</LeadAnalyst> -
XMLType.extract and namespace in XML document
I found some strange behaviour of XMLType:
I create table by means of:
create table conf (id varchar2(10), info sys.xmltype);
I insert xml document into table.
The text of xml document is:
<conference finishPage="/regfinish_en.jsp" id="CID003" xmlns="http://stud.aanet.ru/conf">
<conferencetitle>title1 </conferencetitle>
</conference>
Then I execute:
select a.info.extract('//conferencetitle/text()').getstringval() from conf a
result is empty string.
I replace document with
<conference finishPage="/regfinish_en.jsp" id="CID003" >
<conferencetitle>title1 </conferencetitle>
</conference>
Now result of statement
select a.info.extract('//conferencetitle/text()').getstringval() from conf a
is "title1"
But than I replace document with
<tc:conference finishPage="/regfinish_en.jsp" id="CID003" xmlns:tc="http://stud.aanet.ru/conf">
<tc:conferencetitle>title1 </tc:conferencetitle>
</tc:conference>
and execute
select a.info.extract('//tc:conferencetitle/text()').getstringval() from conf a
or
select a.info.extract('//t:conferencetitle/text()').getstringval() from conf a
The result is "title1"
I receive this result on Oracle for Linux 9.0.1.3.hi, before you set the attribute, you need to create a Namespace element preliminary.
Try the following code:
ELEMENT = DOCUMENT->CREATE_SIMPLE_ELEMENT_NS(
NAME = 'abap'
PREFIX = 'asx'
PARENT = DOCUMENT ).
ATTRIBUTE = DOCUMENT->create_namespace_decl(
NAME = 'XMLNS'
PREFIX = 'asx'
URI = 'http://www.sap.com/abapxml').
ELEMENT->SET_ATTRIBUTE_NODE_NS(
NEW_ATTR = ATTRIBUTE).
Hope my reply will be useful.
thanks -
How to split the IDOCS based on document number change whit out BPM
Hi all,
Thanks,for giving the responce..
Scenario:File to IDoc.
Problum1 : How to Split the IDocs based on document number change in the source file with out BPM.My file contains document numbers like
20000092
20000092
20000092
50000050
50000050
50000065
I want 3 IDocs in target system.i.e 1 for 20000092,20000092,20000092
2 for 50000050,50000050
3 for 5000006
By using external definations i am getting 6 IDOCs insted of 3.
Problum 2:Is there any chnges/modifications in Directory when we are using external definations.
Could u plz provide me the step by step process(Repository/Directory) with using of external definations.
Thanks in advance.
Regards,
KPHI,
for this no need of BPM.
You can think of Idoc bundling concept to acheive this-just you need to do the external definition to change the idoc occurence
/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
to achieve for each document no, one idoc, you can write small user defined function in the mapping with context handling you an achieve this.
For this e.g
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6bd6f69a-0701-0010-a88b-adbb6ee89b34
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/877c0d53-0801-0010-3bb0-e38d5ecd352c
Regards,
Moorthy -
How to declare the field if i want the output as 300.12,00
How to declare the fields if i want the output as 300.12,00
i have a quantity field so i need to place . in place of , and , inplace of .
please help mehi,
declare its as
CURR
field.
Regards
Anver -
How to create the namespace in java dictionory perspective?
hi buddies,
when i try to create the table in javadictinory pers
pective. Its is asking me to enter the name in the format of <NAMESPACE>_<SUFFIX>
HOW TO CREATE THE NAMESPACE
PLZ HELP ME
HARIHi,
Go to Window->Preferences->Dictionary ->Nameserver Prefix
and give the Prefix .
Regards, Anilkumar -
How to display the MS word, powerpoint document in portal?
Hi,
How to display the MS word, powerpoint document in portal?
Regards,
MrChowdaryHi Chowdary,
I think, you can't do this using iview templates. But you can do this using portal component iview. For that, you have to write one java program which should read the contents of the input file and displays in the internet browser itself.
Regards,
Venkatesh. K
/* Points are Welcome */ -
How to get the values from struct data type using java code..?
Hi ,
I am newer to java.
we are using oracle database.
How to get the data from struct data type using java code.
Thanks in Advance.
Regards,
kumarHi Rajeev,
To retrieve a FilterContainer you will need to traverse the report structure:
ReportStructure boReportStructure = boDocumentInstance.getStructure();
ReportContainer boReportContainer = (ReportContainer) boReportStructure.getReportElement(0);
FilterContainer boFilterContainer = null;
if (boReportContainer.hasFilter()) {
boFilterContainer = boReportContainer.getFilter();
} else {
boFilterContainer = boReportContainer.createFilter(LogicalOperator.AND);
Calling boDocumentInstance.getStructure() will retrieve the entire structure for the document.
Calling boReportStructure.getReportElement(0) will retrieve the structure for the first report of the document.
Hope this helps.
Regards,
Dan
Maybe you are looking for
-
Migrate information from one itunes account to another
I have two itunes accounts, and would like to know how to migrate all infromation from one to the other, then close down the old account.
-
'All' filter in Obiee 11g dashboard
Hi All, My client requirement is to see all data in dashboard prompt as well as there should be another item its 'ALL' which return the all data. Example: There is a dashboard filter on CustomerType (like: GOLD,SILVER) , our client want to see the da
-
Issue related to Company name and Ip address
Dear Experts, When a user click the SAP icon the company name is not appearing, shown below When user enters the correct userid and password automatically the system will pop the IP Address screen When the user enter the correct Ip address user gets
-
Low volume, no enhancements tab to fix issue
Hello I have a Pavilion g6 HP laptop, running on windows 8. I am experiencing a problem with very low volume. How can I fix this? I have seen in previous questions that this response has worked for people: Right click the speaker icon in the Taskba
-
Don't see my scanners after installing Elements 11
In the previous versions, I would do a File|Import and then would see my scanners. I would have two options to scan them in, either via the TWAIN driver or WIA support. Now I only see Frame From Video or WIA and WIA takes me to Windows Explorer. I se