Fetch 1-n relation data from XML Data using XMLTable
Dear All,
Following query is running fine.
with t as (select XMLType('<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header/>
<env:Body>
<nm:CustomerCRMByIDResponse xmlns:nm="http://sap.com/xi/CRM/Global2" xmlns:prx="urn:sap.com:proxy:DCT:/1SAI/TAS57DF0B317943DEAE3C49:702">
<MessageHeader/>
<BusinessPartner>
<InternalID>2200117598</InternalID>
<AddressInformation>
<UUID>51471396-9ae8-3cc0-e100-80000a031a28</UUID>
<DefaultIndicator>true</DefaultIndicator>
<Address>
<PostalAddress>
<CountryCode>DE</CountryCode>
<CountryName>Country Name</CountryName>
</PostalAddress>
<Telephone>
<Number>
<SubscriberID>0711/123456</SubscriberID>
<ExtensionID>0</ExtensionID>
<CountryCode>DE</CountryCode>
<CountryDiallingCode>+49</CountryDiallingCode>
<CountryName languageCode="de">Country Name</CountryName>
</Number>
<UsageDeniedIndicator>false</UsageDeniedIndicator>
<MobilePhoneNumberIndicator>false</MobilePhoneNumberIndicator>
<SMSEnabledIndicator>false</SMSEnabledIndicator>
<DefaultIndicator>true</DefaultIndicator>
</Telephone>
<Telephone>
<Number>
<SubscriberID>0711/999999</SubscriberID>
<CountryCode>DE</CountryCode>
<CountryDiallingCode>+49</CountryDiallingCode>
<CountryName languageCode="de">Country Name</CountryName>
</Number>
<UsageDeniedIndicator>false</UsageDeniedIndicator>
<MobilePhoneNumberIndicator>true</MobilePhoneNumberIndicator>
<SMSEnabledIndicator>true</SMSEnabledIndicator>
<DefaultIndicator>false</DefaultIndicator>
</Telephone>
<Facsimile>
<Number>
<SubscriberID>0711/999888</SubscriberID>
<ExtensionID>99</ExtensionID>
<CountryCode>DE</CountryCode>
<CountryDiallingCode>+49</CountryDiallingCode>
<CountryName languageCode="de">Country Name</CountryName>
</Number>
<UsageDeniedIndicator>false</UsageDeniedIndicator>
<DefaultIndicator>true</DefaultIndicator>
</Facsimile>
<EMail>
<URI>[email protected]</URI>
<UsageDeniedIndicator>false</UsageDeniedIndicator>
<DefaultIndicator>true</DefaultIndicator>
</EMail>
<EMail>
<URI>[email protected]</URI>
<UsageDeniedIndicator>false</UsageDeniedIndicator>
<DefaultIndicator>false</DefaultIndicator>
</EMail>
<Web>
<URI>www.xyz.com</URI>
<UsageDeniedIndicator>false</UsageDeniedIndicator>
<DefaultIndicator>true</DefaultIndicator>
</Web>
</Address>
</AddressInformation>
<AddressInformation>
<UUID>514a519b-39a2-4890-e100-80000a031a28</UUID>
<DefaultIndicator>false</DefaultIndicator>
<Address>
<PostalAddress>
<CountryCode>AT</CountryCode>
<CountryName>Österreich</CountryName>
</PostalAddress>
</Address>
</AddressInformation>
</BusinessPartner>
</nm:CustomerCRMByIDResponse>
</env:Body>
</env:Envelope>') xml_data from dual)
SELECT xmlresponse.*
FROM t, XMLTable(Xmlnamespaces('http://www.w3.org/2003/05/soap-envelope' AS "env",
'http://sap.com/xi/CRM/Global2' AS "nm",
'urn:sap.com:proxy:DCT:/1SAI/TAS57DF0B317943DEAE3C49:702' AS "prx"
'for $BusinessPartner in /env:Envelope/env:Body/nm:CustomerCRMByIDResponse/BusinessPartner
return $BusinessPartner'
PASSING xml_data
COLUMNS
Internalid Varchar2(4000) Path 'InternalID'
) xmlresponse;As you can see, one "BusinessPartner" can have multiple "AddressInformation"
and one "AddressInformation" can have multiple "Telephone".
Can someone suggest me how can I extract both InternalID & UUID in one query? For above example output should look as follows..
InternalID UUID
2200117598 51471396-9ae8-3cc0-e100-80000a031a28
2200117598 514a519b-39a2-4890-e100-80000a031a28Thank you very much in advance.
Regards,
Hari
Here is a basic example of one method to achieve what you need
SELECT xmlresponse.Internalid, xml2.uuid
FROM t,
XMLTable(Xmlnamespaces('http://www.w3.org/2003/05/soap-envelope' AS "env",
'http://sap.com/xi/CRM/Global2' AS "nm"
'/env:Envelope/env:Body/nm:CustomerCRMByIDResponse/BusinessPartner'
PASSING xml_data
COLUMNS
Internalid Varchar2(20) Path 'InternalID',
addrinfoxml XMLType PATH 'AddressInformation'
) xmlresponse,
XMLTable('/AddressInformation'
PASSING xmlresponse.addrinfoxml
COLUMNS
UUID Varchar2(80) Path 'UUID'
) xml2;Changes:
I removed one of namespaces as you only need to include those included in an XPath statement.
I shortened your datatypes.
I went for the simple XMLTable joined to an XMLTable approach, instead of a single XMLTable using a FLWOR statement.
You can include the addrinfoxml column to your SELECT list to see the data being passed between the two if you want.
Addition:
Here's one approach for a single XMLTable.
SELECT xmlresponse.*
FROM t,
XMLTable(Xmlnamespaces('http://www.w3.org/2003/05/soap-envelope' AS "env",
'http://sap.com/xi/CRM/Global2' AS "nm"
'for $BP in /env:Envelope/env:Body/nm:CustomerCRMByIDResponse/BusinessPartner
for $ai in $BP /AddressInformation
return <e>{$BP/InternalID}{$ai/UUID}</e>'
PASSING xml_data
COLUMNS
Internalid Varchar2(20) Path 'InternalID',
UUID Varchar2(80) Path 'UUID'
) xmlresponse;Edited by: A_Non on Mar 25, 2013 9:41 AM
Added in XQuery solution
Similar Messages
-
How do I generate HTML from XML & XSL using XSL Processor ?
I want to generate a HTML from XML & XSL using XDK for C on
linux-8i.
I run the XSLSample well.
But it only generate a XML from a XML & a XSL.
Can any one give me some advise or sample code?Just use HTML tags instead of xml tags in your stylesheet, and
you'll generate HTML instead.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="ROWSET">
<table border="1" cellspacing="0">
<xsl:for-each select="ROW">
<tr>
<td><xsl:value-of select="EMPNO"/></td>
<td><xsl:value-of select="ENAME"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet> -
Select data as table from xml string using xquery.
Hi ,
I have this xml
declare @xml xml
set @xml =' <StudentsData>
<StudentData>
<id>1</id>
<subjects>
<subject>
<subid>1</subid>
<marks>30</marks>
</subject>
<subject>
<subid>2</subid>
<marks>40</marks>
</subject>
</subjects>
</StudentData>
<StudentData>
<id>2</id>
<subjects>
<subject>
<subid>1</subid>
<marks>30</marks>
</subject>
<subject>
<subid>2</subid>
<marks>40</marks>
</subject>
</subjects>
</StudentData>
</StudentsData>'
select @xml
I wan the output to be shown as
id subid marks
1 1 30
1 2 40
2 1 30
2 2 40
how can i do this using XQUERY in sqlserver ?.
Thanks in advance for any help.how can i do this using XQUERY in sqlserver ?
Sure you can and it's easy:
declare @xml xml
set @xml =' <StudentsData>
<StudentData>
<id>1</id>
<subjects>
<subject>
<subid>1</subid>
<marks>30</marks>
</subject>
<subject>
<subid>2</subid>
<marks>40</marks>
</subject>
</subjects>
</StudentData>
<StudentData>
<id>2</id>
<subjects>
<subject>
<subid>1</subid>
<marks>30</marks>
</subject>
<subject>
<subid>2</subid>
<marks>40</marks>
</subject>
</subjects>
</StudentData>
</StudentsData>'
select students.Rows.value('subid[1]', 'int') AS id
,students.Rows.value('marks[1]', 'int') AS marks
FROM @xml.nodes('/StudentsData/StudentData/subjects/subject') AS students(Rows)
Olaf Helper
[ Blog] [ Xing] [ MVP] -
How to delete a perticular node from xml file using java code
Hii All,
Now i am trying to delete a perticular node from xml file.Like...
XML file:
<Licence>
<SERVER>
<was id="1">1</was>
<was id="2">2</was>
</SERVER>
</LICENCE>
I am working in messaging service using JABBER framework with whiteboard facility.
Here Some commands i have created to add,modify,delete nodes from xml file.They Are
1.If u want to add a new node then.
create Licence.SERVER <ss id="3">ddd</ss> lic.xml
(here u want to add a new node called "ss" under Licence.SERVER.
And lic.xml is tyhe xml file name where it was saved.
2.If u want to delete a node(Suppose <was id="1">),then the command should be
delete Licence.SERVER.was:id='"1" lic.xml
A problem arises that here it find two was attributes.And it delete the last was attribute,not the requested node.
PLEASE HELP ME IN SOLVING THIS CODE..
------------------------------------Looks like you clicked on "Post" before you pasted in the code you were talking about.
-
How to remove white spaces from XML content using Coldfusion?
Hi,
Can anybody help me in removing white spaces in between the tags from the below XML content using coldfusion?
XML content:
<?xml version="1.0" encoding="UTF-8"?> <chart showdates="true" today="08/12/2009"> <phases> <phase color="CCFFCC" name="Funded"/> <phase color="CDCD67" name="Concept"/> <phase color="99CCFF" name="Feasibility"/> <phase color="0099FF" name="Development"/> <phase color="0099FF" name="Development"/> <phase color="CC99FF" name="Close-out"/> <phase color="909090" name="Sustaining"/> </phases><program name=""> <project enddate=" 30/03/2007 " id="43250" startdate=" 28/02/2006 "> <version enddate=" 30/03/2007 " number=" 1" startdate=" 28/02/2006 "> <phase color="CCFFCC" currentdate="23/03/2006" name="Project Start" plandate="28/02/2006" type="phase"/> <phase color="99CCFF" currentdate="04/04/2006" name="Feasibility Closure" plandate="31/05/2006" type="phase"/> <phase color="0099FF" currentdate="29/03/2007" name="Commercialization" plandate="30/12/2006" type="phase"/> <phase color="CC99FF" currentdate="30/03/2007" name="Project Closed" plandate="30/03/2007" type="phase"/> <phase color="909090" currentdate="" name="Obsolescence" plandate="" type="phase"/> </version> </project> </program> </chart>
Output I am expecting is like below,
<?xml version="1.0" encoding="UTF-8"?><chart showdates="true" today="08/12/2009"><phases><phase color="CCFFCC" name="Funded"/><phase color="CDCD67" name="Concept"/><phase color="99CCFF" name="Feasibility"/><phase color="0099FF" name="Development"/><phase color="0099FF" name="Development"/><phase color="CC99FF" name="Close-out"/><phase color="909090" name="Sustaining"/></phases><program name=""><project enddate=" 30/03/2007 " id="43250" startdate=" 28/02/2006 "><version enddate=" 30/03/2007 " number=" 1" startdate=" 28/02/2006 "><phase color="CCFFCC" currentdate="23/03/2006" name="Project Start" plandate="28/02/2006" type="phase"/><phase color="99CCFF" currentdate="04/04/2006" name="Feasibility Closure" plandate="31/05/2006" type="phase"/><phase color="0099FF" currentdate="29/03/2007" name="Commercialization" plandate="30/12/2006" type="phase"/><phase color="CC99FF" currentdate="30/03/2007" name="Project Closed" plandate="30/03/2007" type="phase"/><phase color="909090" currentdate="" name="Obsolescence" plandate="" type="phase"/></version> </project></program></chart>
Thanks in advance,
Regards,
Manoz.Daverms,
Thanks for the quick turn around..
I have applied the solution what you suggested above (<cfprocessingdrirective suppresswhitespaces="yes"), still whitespaces are existing in my output.
The output what I am getting is,
(blue color part is my output & red color indicates whitespaces)
<?xml version="1.0" encoding="UTF-8"?>
<chart showdates="true" today="09/12/2009">
<phases>
<phase color="CCFFCC" name="Funded"/>
<phase color="CDCD67" name="Concept"/>
<phase color="99CCFF" name="Feasibility"/>
<phase color="0099FF" name="Development"/>
<phase color="0099FF" name="Development"/>
<phase color="CC99FF" name="Close-out"/>
<phase color="909090" name="Sustaining"/>
</phases>
<program name="">
<project enddate=" 01/01/2010 " id="12059" startdate=" 20/06/2003 ">
<version enddate=" 01/01/2010 " number=" 1" startdate=" 20/06/2003 ">
<phase color="CCFFCC" currentdate="20/06/2003" name="Project Start" plandate="20/06/2003" type="phase"/>
<phase color="CDCD67" currentdate="" name="Concept Closure" plandate="" type="phase"/>
<phase color="99CCFF" currentdate="20/06/2003" name="Feasibility Closure" plandate="20/06/2003" type="phase"/>
<phase color="F0FF00" currentdate="" name="Alpha Test" plandate="" type="milestone"/>
<phase color="F0FF00" currentdate="26/07/2004" name="Beta Test" plandate="31/05/2004" type="milestone"/>
<phase color="0099FF" currentdate="29/06/2005" name="Commercialization" plandate="08/12/2004" type="phase"/>
<phase color="CC99FF" currentdate="24/02/2006" name="Project Closed" plandate="01/01/2010" type="phase"/>
</version>
<subproject enddate=" 16/10/2008 " id="11809" name="espWatcher Pricing Toolkit" startdate=" 01/08/2003 ">
<version enddate=" 16/10/2008 " number=" 1" startdate=" 01/08/2003 ">
<phase color="CCFFCC" currentdate="01/08/2003" name="Project Start" plandate="01/08/2003" type="phase"/>
<phase color="99CCFF" currentdate="" name="Feasibility Closure" plandate="" type="phase"/>
<phase color="0099FF" currentdate="15/06/2005" name="Commercialization" plandate="08/12/2004" type="phase"/>
<phase color="CC99FF" currentdate="16/10/2008" name="Project Closed" plandate="16/10/2008" type="phase"/>
</version>
</subproject>
<subproject enddate=" 31/12/2070 " id="35704" name="espWatcher version 2 (2005)" startdate=" 01/01/2005 ">
<version enddate=" 31/12/2070 " number=" 1" startdate=" 01/01/2005 ">
<phase color="CCFFCC" currentdate="01/01/2005" name="Project Start" plandate="01/01/2005" type="phase"/>
<phase color="99CCFF" currentdate="01/07/2005" name="Feasibility Closure" plandate="01/07/2005" type="phase"/>
<phase color="0099FF" currentdate="31/03/2006" name="Commercialization" plandate="31/03/2006" type="phase"/>
<phase color="CC99FF" currentdate="31/12/2070" name="Project Closed" plandate="31/12/2070" type="phase"/>
</version>
</subproject>
</project>
</program>
</chart>
However this solution removes most of the whitespaces, I want exact output as flash file is expecting so..
Where ever I am calling the CF functions, there I am getting the whitespaces. like below cases.
startdate="#getProjectStartDate(sProjectIdList)#" -> output I am getting for this statement is -> " 12/09/2009 "
Please assist me...
Regards,
Manoz. -
Difficulty extracting from XMLTYPE column using XMLTABLE
Hi Folks.
I am currently trying to shred the contents of an XML document that is stored on our schema in a XMLType column. The XMLYTYPE column is pointing to several schemas that are registered within the database.
If I take a subset of the XML from one of the files and create an XMLTYPE column on the fly, I am able to extract data using the XMLTABLE syntax. If I try the same thing on the XMLTYPE column in the table registered to schemas stored in the database I get no joy.
Please see below for an example.
Please note that this is only a small segment of the original XML document which is very large. The XML document has one <RTDRFileHeader> and <ConnectionList> nodes per document but many <Connection> nodes beneath the <ConnectionList>.
My requirement is to RETRIEVE ALL the data contained in the <Connection> elements beneath the <ConnectionList>. How do I achieve this?
CREATE TABLE ag_test2 as
SELECT XMLTYPE(
'<RTDR xmlns:tadig-gen="https://infocentre.gsm.org/TADIG-GEN" xmlns="https://infocentre.gsm.org/TADIG-RTDR">
<RTDRFileHeader>
<Prefix>MRTDR</Prefix>
<Sender>EDSCH</Sender>
<Recipient>NXTMP</Recipient>
<PMN>UKRAS</PMN>
<ReportSeqNo>5</ReportSeqNo>
<TADIGGenSchemaVersion>2.2</TADIGGenSchemaVersion>
<RTDRSchemaVersion>1.1</RTDRSchemaVersion>
<CreationTmstp>2009-09-04T04:04:00.000000+02:00</CreationTmstp>
</RTDRFileHeader>
<ConnectionList xmlns="https://infocentre.gsm.org/TADIG-RTDR">
<Connection xmlns="https://infocentre.gsm.org/TADIG-RTDR">
<VPMN>UKRAS</VPMN>
<HPMN>LIEK9</HPMN>
<FileItemList>
<FileItem>
<FileID>CDUKRASLIEK901274-00005-m</FileID>
<ExchTmstp>2009-08-24T12:07:22.000000+02:00</ExchTmstp>
<FileType>
<InitTAP>
<TAPSeqNo>1274</TAPSeqNo>
<NotifFileInd>true</NotifFileInd>
<ChargeInfo>
<TAPTxCutoffTmstp>2009-08-24T12:52:10.000000+03:00</TAPTxCutoffTmstp>
<TAPAvailTmstp>2009-08-24T11:52:10.000000+02:00</TAPAvailTmstp>
<TAPCurrency>SDR</TAPCurrency>
<TotalNetCharge>0</TotalNetCharge>
<TotalTax>0</TotalTax>
</ChargeInfo>
</InitTAP>
</FileType>
</FileItem>
<FileItem>
<FileID>CDUKRASLIEK901280-00005-m</FileID>
<ExchTmstp>2009-08-30T12:14:39.000000+02:00</ExchTmstp>
<FileType>
<InitTAP>
<TAPSeqNo>1280</TAPSeqNo>
<NotifFileInd>true</NotifFileInd>
<ChargeInfo>
<TAPTxCutoffTmstp>2009-08-30T12:52:34.000000+03:00</TAPTxCutoffTmstp>
<TAPAvailTmstp>2009-08-30T11:52:34.000000+02:00</TAPAvailTmstp>
<TAPCurrency>SDR</TAPCurrency>
<TotalNetCharge>0</TotalNetCharge>
<TotalTax>0</TotalTax>
</ChargeInfo>
</InitTAP>
</FileType>
</FileItem>
</FileItemList>
</Connection>
</ConnectionList>
</RTDR> ') as xml from dual
Question: When I run the following query no rows are returned although the table is populated with XML segment above. Any explanation as to why and how can I resolve this?
SELECT rtd2."VPMN"
,rtd2."Recipient"
,rtd2."ReportSeqNo"
FROM ag_test2 r
,XMLTABLE('/RTDR'
PASSING r.xml
COLUMNS "VPMN" VARCHAR2(5) PATH '/RTDRFileHeader/ConnectionList/Connection/VPMN'
,"Recipient" VARCHAR2(5) PATH '/RTDRFileHeader/Recipient'
,"ReportSeqNo" INTEGER PATH '/RTDRFileHeader/ReportSeqNo'
) rtd2; From my other investigations the following query works OK when the same XML segment is created dynamically by performing an SELECT XMLTYPE ... FROM DUAL compared to the method above. Can anybody provide an explanation?
WITH t as (select XMLTYPE(
'<RTDR>
<RTDRFileHeader>
<Prefix>MRTDR</Prefix>
<Sender>EDSCH</Sender>
<Recipient>NXTMP</Recipient>
<PMN>UKRAS</PMN>
<ReportSeqNo>5</ReportSeqNo>
<TADIGGenSchemaVersion>2.2</TADIGGenSchemaVersion>
<RTDRSchemaVersion>1.1</RTDRSchemaVersion>
<CreationTmstp>2009-09-04T04:04:00.000000+02:00</CreationTmstp>
</RTDRFileHeader>
<ConnectionList>
<Connection>
<VPMN>UKRAS</VPMN>
<HPMN>LIEK9</HPMN>
<FileItemList>
<FileItem>
<FileID>CDUKRASLIEK901274-00005-m</FileID>
<ExchTmstp>2009-08-24T12:07:22.000000+02:00</ExchTmstp>
<FileType>
<InitTAP>
<TAPSeqNo>1274</TAPSeqNo>
<NotifFileInd>true</NotifFileInd>
<ChargeInfo>
<TAPTxCutoffTmstp>2009-08-24T12:52:10.000000+03:00</TAPTxCutoffTmstp>
<TAPAvailTmstp>2009-08-24T11:52:10.000000+02:00</TAPAvailTmstp>
<TAPCurrency>SDR</TAPCurrency>
<TotalNetCharge>0</TotalNetCharge>
<TotalTax>0</TotalTax>
</ChargeInfo>
</InitTAP>
</FileType>
</FileItem>
<FileItem>
<FileID>CDUKRASLIEK901280-00005-m</FileID>
<ExchTmstp>2009-08-30T12:14:39.000000+02:00</ExchTmstp>
<FileType>
<InitTAP>
<TAPSeqNo>1280</TAPSeqNo>
<NotifFileInd>true</NotifFileInd>
<ChargeInfo>
<TAPTxCutoffTmstp>2009-08-30T12:52:34.000000+03:00</TAPTxCutoffTmstp>
<TAPAvailTmstp>2009-08-30T11:52:34.000000+02:00</TAPAvailTmstp>
<TAPCurrency>SDR</TAPCurrency>
<TotalNetCharge>0</TotalNetCharge>
<TotalTax>0</TotalTax>
</ChargeInfo>
</InitTAP>
</FileType>
</FileItem>
</FileItemList>
</Connection>
</ConnectionList>
</RTDR> ') as xml from dual )
SELECT rtd2."VPMN"
,rtd2."HPMN"
FROM t r
,XMLTABLE('/RTDR/ConnectionList'
PASSING r.xml
COLUMNS "VPMN" VARCHAR2(5) PATH '/ConnectionList/Connection/VPMN'
,"HPMN" VARCHAR2(5) PATH '/ConnectionList/Connection/HPMN'
) rtd2;
Any comments, suggestions, pointers gratefully received.
Many thanks
Kind regards
Simon GaddSimon
It appears to work as expected for me in 11.2.0.1.0
C:\xdb\customers\Mapeley>sqlplus /nolog @testcase %CD%
SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 18 14:26:56 2009
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> spool testase.log
SQL> --
SQL> connect / as sysdba
Connected.
SQL> --
SQL> set define on
SQL> set timing on
SQL> --
SQL> define USERNAME = MAPELEY
SQL> --
SQL> def PASSWORD = &USERNAME
SQL> --
SQL> def XMLDIR = &1
SQL> --
SQL> def USER_TABLESPACE = USERS
SQL> --
SQL> def TEMP_TABLESPACE = TEMP
SQL> --
SQL> drop user &USERNAME cascade
2 /
old 1: drop user &USERNAME cascade
new 1: drop user MAPELEY cascade
User dropped.
Elapsed: 00:00:04.57
SQL> grant create any directory, drop any directory, connect, resource, alter se
ssion, create view to &USERNAME identified by &PASSWORD
2 /
old 1: grant create any directory, drop any directory, connect, resource, alte
r session, create view to &USERNAME identified by &PASSWORD
new 1: grant create any directory, drop any directory, connect, resource, alte
r session, create view to MAPELEY identified by MAPELEY
Grant succeeded.
Elapsed: 00:00:00.03
SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespa
ce &TEMP_TABLESPACE
2 /
old 1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tabl
espace &TEMP_TABLESPACE
new 1: alter user MAPELEY default tablespace USERS temporary tablespace TEMP
User altered.
Elapsed: 00:00:00.00
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> create or replace directory XMLDIR as '&XMLDIR'
2 /
old 1: create or replace directory XMLDIR as '&XMLDIR'
new 1: create or replace directory XMLDIR as 'C:\xdb\customers\Mapeley'
Directory created.
Elapsed: 00:00:00.01
SQL> var SCHEMAURL varchar2(256)
SQL> VAR XMLSCHEMA CLOB;
SQL> VAR INSTANCE CLOB;
SQL> VAR DOCPATH VARCHAR2(700)
SQL> --
SQL> set define off
SQL> --
SQL> alter session set events='31098 trace name context forever'
2 /
Session altered.
Elapsed: 00:00:00.01
SQL> declare
2 XMLSCHEMA XMLTYPE := XMLTYPE(bfilename('XMLDIR','tadig_gen_2.2.xsd'),NLS_
CHARSET_ID('AL32UTF8'));
3 begin
4 :SCHEMAURL:= 'tadig-gen-2.2.xsd';
5 xdb_annotate_schema.disableDefaultTables(XMLSCHEMA);
6 dbms_xmlschema.registerSchema
7 (
8 schemaurl => :SCHEMAURL,
9 schemadoc => XMLSCHEMA,
10 local => TRUE,
11 genTypes => TRUE,
12 genBean => FALSE,
13 genTables => TRUE
14 );
15 end;
16 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.17
SQL> declare
2 XMLSCHEMA XMLTYPE := XMLTYPE(bfilename('XMLDIR','tadig_rtdr.xsd'),NLS_CHA
RSET_ID('AL32UTF8'));
3 begin
4 :SCHEMAURL:= 'tadig_rtdr.xsd';
5 xdb_annotate_schema.addDefaultTable(XMLSCHEMA,'RTDR','RTDR_TABLE');
6 xdb_annotate_schema.disableDefaultTables(XMLSCHEMA);
7 dbms_xmlschema.registerSchema
8 (
9 schemaurl => :SCHEMAURL,
10 schemadoc => XMLSCHEMA,
11 local => TRUE,
12 genTypes => TRUE,
13 genBean => FALSE,
14 genTables => TRUE
15 );
16 end;
17 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:05.66
SQL> select table_name
2 from USER_XML_TABLES
3 /
TABLE_NAME
RTDR_TABLE
Elapsed: 00:00:00.04
SQL> select count(*)
2 from USER_NESTED_TABLES
3 /
COUNT(*)
17
Elapsed: 00:00:00.43
SQL> desc RTDR_TABLE
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "tadig_rtdr.xsd" Element "RTDR") STORAGE Object-r
elational TYPE "RTDR8050_T"
SQL> --
SQL> insert into RTDR_TABLE values (XMLTYPE(bfilename('XMLDIR','MRTDREDSCHNXTMPU
KRAS00001.xml'),NLS_CHARSET_ID('AL32UTF8')))
2 /
1 row created.
Elapsed: 00:00:16.91
SQL> commit
2 /
Commit complete.
Elapsed: 00:00:00.01
SQL> set autotrace on explain lines 256 long 100000 pages 0
SQL> --
SQL> SELECT rtd3."VPMN"
2 ,rtd2."Recipient"
3 ,rtd2."ReportSeqNo"
4 FROM RTDR_TABLE r
5 ,XMLTABLE
6 (
7 xmlnamespaces
8 (
9 default 'https://infocentre.gsm.org/TADIG-RTDR'
10 ),
11 '/RTDR'
12 PASSING r.object_value
13 COLUMNS
14 "ConnectionXML" XMLTYPE PATH 'ConnectionList/Connection'
15 ,"Recipient" VARCHAR2(5) PATH 'RTDRFileHeader/Recipient'
16 ,"ReportSeqNo" INTEGER PATH 'RTDRFileHeader/ReportSeqNo'
17 ) rtd2
18 ,XMLTABLE
19 (
20 xmlnamespaces
21 (
22 default 'https://infocentre.gsm.org/TADIG-RTDR'
23 ),
24 '/Connection'
25 PASSING rtd2."ConnectionXML"
26 COLUMNS
27 "VPMN" VARCHAR2(6) PATH 'VPMN'
28 ) rtd3
29 /
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1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 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
641 rows selected.
Elapsed: 00:00:01.15
Execution Plan
Plan hash value: 3612307998
| Id | Operation | Name | Rows | Bytes | Co
st (%CPU)| Time |
| 0 | SELECT STATEMENT | | 641 | 2539K|
9 (12)| 00:00:01 |
|* 1 | HASH JOIN | | 641 | 2539K|
9 (12)| 00:00:01 |
|* 2 | TABLE ACCESS FULL| RTDR_TABLE | 1 | 2045 |
3 (0)| 00:00:01 |
| 3 | TABLE ACCESS FULL| SYS_NTeF0jsoIcQsOueVI+sFGk0g== | 641 | 1259K|
5 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - access("SYS_ALIAS_0"."NESTED_TABLE_ID"="RTDR_TABLE"."SYS_NC0002300024$")
2 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.
w3.org/2001/XMLSchema-insta
nce" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xd
b/dav.xsd"><read-properties
/><read-contents/></privilege>'))=1)
Note
- dynamic sampling used for this statement (level=2)
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64
bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
C:\xdb\customers\Mapeley> -
Re:How fetch the other servers data using fm:TH_SERVER_LIST
Hi,
using this function module TH_SERVER_LIST i could fetch the data from current server but i'm unable to
do the same from other servers,so plz tell me how to fetch the data from other servers.
Regards
narendarThis is RFC-enabled FM so you can give RFC destination of other servers.
-
How to fetch,update,insert the data using database link on diff. servers
I am using two oracle server.
1st) Oracle 9i ( Server1 )
2nd) Oracle 10g ( Server2 )
3) Forms 6i
I have created a database link on Server 1 for connecting to Server 2.
I written a piece of code which will be executed in Forms 6i and is connected to Server1.
The piece of code brings the data from SErver2 via cursor and I try to insert / update the relevant records
in my Server1 database users.
The Insert/Update runs sucessfully but at the time of commit I get the following errors
in Forms ORA-01041:internal error. hostdef does not exist.
Then it forcefully rollback the data and come out of the application.
contact :email-id : [email protected]Suggest you test your code from sqlplus before running from forms.
Start by testing a simple "select sysdate from dual@<database link>;" then test select from application_table@<database link> then test the insert/update code. After it works from sqlplus, then try it from forms. -
Fetching the sales order data using both system status and user status
Hi,
Could any one tell me how to fetch sales orders using both system status and user status.
My requirement is to fetch sales order data in a report where the user enters the system status and user status in the selection screen fields.
For example i need sales orders where the system status is I1002 i.e. OPEN and user status is E0002 (status profile CMSCON0) that is In Process
Early replies are appreciated.
Thanks
TanveerHi,
The system status and user status are stored in CRM_JCDS & CRM_JEST tables you can get the all the order GUID on particular status further pass the order GUID in table CRMD_ORDERADM_H to get transaction ID.
Regards,
Dipesh. -
Relational output from XML with attributes
I'm using a 10g
I have this XML.
<items>
<item name="Book" price="12" itemnumber="230" quantity="57" detail="Oracle book" company="Oracle" />
<item name="Book" price="23" itemnumber="244" quantity="7" detail="XML book" company="Oracle" />
</items>
I want the following relational output:
name price itemnumber quantity detail company
Book 12 230 57 Oracle book Oracle
Book 23 244 7 XML book Oracle
I am new to this xml stuff and would appreciate any help.
Thanks!You can solve this via xmltable (>= V. 10.2) or the use of a table(xmlsequence(extract())) contruct (<= V. 10.1 <<) or, for instance, via XQuery (>= V. 10.2).
-
Couldn't parse image from XML file using NSXMLParser
Hi all, Since i am newbie to developing iPhone application, i have problem in parsing XML data.
I use the following code for parsing XML file, this is RootViewController.h file
#import <UIKit/UIKit.h>
#import "SlideMenuView.h"
#define kNameValueTag 1
#define kColorValueTag 2
#define kSwitchTag 100
@class DetailViewController;
@interface RootViewController : UIViewController <UITableViewDataSource, UITableViewDelegate> {
DetailViewController *detailViewController;
UITableView *myTable;
UIActivityIndicatorView *activityIndicator;
UIButton *btn;
CGSize cellSize;
NSXMLParser *rssParser;
NSMutableArray *stories;
NSMutableDictionary *item;
NSString *currentElement;
NSMutableString *currentTitle, *currentDate, *currentSummary, *currentLink, *currentImage;
SlideMenuView *slideMenu;
NSMutableArray *buttonArray;
UIButton *rubic;
UIButton *buurt;
UIButton *beeld;
UILabel *lbl;
NSString *url;
@property (nonatomic, retain) UITableView *myTable;
@property (nonatomic, retain) DetailViewController *detailViewController;
@property (nonatomic, retain) SlideMenuView *slideMenu;
@property (nonatomic, retain) UIButton *btn;
@property (nonatomic, retain) NSMutableArray *buttonArray;
@property (nonatomic, retain) UIButton *rubic;
@property (nonatomic, retain) UIButton *buurt;
@property (nonatomic, retain) UIButton *beeld;
@property (nonatomic, retain) UILabel *lbl;
@end
below is the RootViewController.m file,
#import <Foundation/Foundation.h>
#import "RootViewController.h"
#import "DetailViewController.h"
#import "SlideMenuView.h"
@implementation RootViewController
@synthesize rubic, buurt, beeld, detailViewController, myTable, btn, buttonArray, slideMenu, lbl;
- (void)parseXMLFileAtURL:(NSString *)URL {
stories = [[NSMutableArray alloc] init];
//you must then convert the path to a proper NSURL or it won't work
NSURL *xmlURL = [NSURL URLWithString:URL];
// here, for some reason you have to use NSClassFromString when trying to alloc NSXMLParser, otherwise you will get an object not found error
// this may be necessary only for the toolchain
rssParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL];
// Set self as the delegate of the parser so that it will receive the parser delegate methods callbacks.
[rssParser setDelegate:self];
// Depending on the XML document you're parsing, you may want to enable these features of NSXMLParser.
[rssParser setShouldProcessNamespaces:NO];
[rssParser setShouldReportNamespacePrefixes:NO];
[rssParser setShouldResolveExternalEntities:NO];
[rssParser parse];
- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError {
NSString * errorString = [NSString stringWithFormat:@"Unable to download story feed from web site (Error code %i )", [parseError code]];
NSLog(@"error parsing XML: %@", errorString);
UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Error loading content" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[errorAlert show];
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{
//NSLog(@"found this element: %@", elementName);
currentElement = [elementName copy];
if ([elementName isEqualToString:@"item"]) {
// clear out our story item caches...
item = [[NSMutableDictionary alloc] init];
currentTitle = [[NSMutableString alloc] init];
currentDate = [[NSMutableString alloc] init];
currentSummary = [[NSMutableString alloc] init];
currentLink = [[NSMutableString alloc] init];
currentImage = [[NSMutableString alloc] init];
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
//NSLog(@"ended element: %@", elementName);
if ([elementName isEqualToString:@"item"]) {
// save values to an item, then store that item into the array...
[item setObject:currentTitle forKey:@"title"];
[item setObject:currentSummary forKey:@"summary"];
[item setObject:currentDate forKey:@"date"];
[item setObject:currentImage forKey:@"enclosure"];
[stories addObject:[item copy]];
NSLog(@"adding story: %@", currentTitle);
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
//NSLog(@"found characters: %@", string);
// save the characters for the current item...
if ([currentElement isEqualToString:@"title"]) {
[currentTitle appendString:string];
} else if ([currentElement isEqualToString:@"description"]) {
[currentSummary appendString:string];
} else if ([currentElement isEqualToString:@"pubDate"]) {
[currentDate appendString:string];
} else if ([currentElement isEqualToString:@"enclosure"]) {
[currentImage appendString:string];
- (void)parserDidEndDocument:(NSXMLParser *)parser {
[activityIndicator stopAnimating];
[activityIndicator removeFromSuperview];
NSLog(@"all done!");
NSLog(@"stories array has %d items", [stories count]);
[myTable reloadData];
- (void)loadView {
//self.title = @"GVA_iPhone";
//UIImage *img = [UIImage imageNamed: @"gva_v2.1.png"];
CGRect frame = [[UIScreen mainScreen] bounds];
UIView *aView = [[UIView alloc] initWithFrame:frame];
aView.backgroundColor = [UIColor grayColor];
self.view = aView;
[aView release];
lbl = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 33.0, 320.0, 30.0)];
lbl.backgroundColor = [UIColor colorWithRed:21.0/255.0 green:113.0/255.0 blue:194.0/255.0 alpha:1.0];
lbl.textColor = [UIColor whiteColor];
lbl.font = [UIFont boldSystemFontOfSize:18.0];
[self.view addSubview:lbl];
[lbl release];
buttonArray = [[NSMutableArray alloc] init];
for(int i = 1; i < 4; i++)
// Rounded rect is nice
//UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
// Give the buttons a width of 100 and a height of 30. The slide menu will take care of positioning the buttons.
// If you don't know that 100 will be enough, use my function to calculate the length of a string. You find it on my blog.
[btn setFrame:CGRectMake(0.0f,3.0f, 120.0f, 30.0f)];
switch(i){
case 1:
[btn setTitle:[NSString stringWithFormat:@" Snel", i+1] forState:UIControlStateNormal];
[btn setBackgroundImage:[UIImage imageNamed:@"topbg02.png"] forState:UIControlStateNormal];
lbl.text = @" Snel";
[btn addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
[buttonArray addObject:btn];
break;
case 2:
[btn setTitle:[NSString stringWithFormat:@" Binnenland", i+1] forState:UIControlStateNormal];
[btn setBackgroundImage:[UIImage imageNamed:@"topbg02.png"] forState:UIControlStateNormal];
[btn addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
[buttonArray addObject:btn];
break;
case 3:
[btn setTitle:[NSString stringWithFormat:@" Buitenland", i+1] forState:UIControlStateNormal];
[btn setBackgroundImage:[UIImage imageNamed:@"topbg02.png"] forState:UIControlStateNormal];
[btn addTarget:self action:@selector(buttonTouched:) forControlEvents:UIControlEventTouchUpInside];
[buttonArray addObject:btn];
break;
[btn release];
slideMenu = [[SlideMenuView alloc]initWithFrameColorAndButtons:CGRectMake(0.0, 3.0, 330.0, 30.0) backgroundColor:[UIColor blackColor] buttons:buttonArray];
[self.view addSubview:slideMenu];
UITableView *aTableView = [[UITableView alloc] initWithFrame:CGRectMake(0.0, 63.0, 320.0, 310.0)];
aTableView.dataSource = self;
aTableView.delegate = self;
aTableView.rowHeight = 120;
self.myTable = aTableView;
[aTableView release];
[self.view addSubview:myTable];
rubic = [[UIButton alloc]initWithFrame:CGRectMake(0.0, 370.0, 105.0, 50.0)];
[rubic setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[rubic setBackgroundImage:[UIImage imageNamed:@"MOUSEOVER.png"] forState:UIControlStateNormal];
[rubic addTarget:self action:@selector(buttonBinn:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:rubic];
UILabel *lblRub = [[UILabel alloc]initWithFrame:CGRectMake(10.0, 385.0, 45.0, 12.0)];
lblRub.text = @"Rubriek";
lblRub.font = [UIFont boldSystemFontOfSize:11.0];
lblRub.backgroundColor = [UIColor clearColor];
lblRub.textColor = [UIColor whiteColor];
[self.view addSubview:lblRub];
UIImageView *imgCat = [[UIImageView alloc] initWithFrame:CGRectMake(58.0, 375.0, 39.0, 36.0)];
imgCat.image = [UIImage imageNamed:@"category_icon.png"];
[self.view addSubview:imgCat];
buurt = [[UIButton alloc] initWithFrame:CGRectMake(105.0, 370.0, 108.0, 50.0)];
[buurt setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[buurt setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
[buurt addTarget:self action:@selector(buttonBuurt:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:buurt];
UILabel *lblGlo = [[UILabel alloc]initWithFrame:CGRectMake(112.0, 385.0, 59.0, 12.0)];
lblGlo.text = @"In de Buurt";
lblGlo.font = [UIFont boldSystemFontOfSize:11.0];
lblGlo.backgroundColor = [UIColor clearColor];
lblGlo.textColor = [UIColor whiteColor];
[self.view addSubview:lblGlo];
UIImageView *imgGlo = [[UIImageView alloc] initWithFrame:CGRectMake(173.0, 375.0, 39.0, 36.0)];
imgGlo.image = [UIImage imageNamed:@"globe_icon.png"];
[self.view addSubview:imgGlo];
beeld = [[UIButton alloc]initWithFrame:CGRectMake(213.0, 370.0, 108.0, 50.0)];
[beeld setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[beeld setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
[beeld addTarget:self action:@selector(buttonBeeld:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:beeld];
UILabel *lblCam = [[UILabel alloc]initWithFrame:CGRectMake(228.0, 385.0, 45.0, 12.0)];
lblCam.text = @"In Beeld";
lblCam.font = [UIFont boldSystemFontOfSize:11.0];
lblCam.backgroundColor = [UIColor clearColor];
lblCam.textColor = [UIColor whiteColor];
[self.view addSubview:lblCam];
UIImageView *imgCam = [[UIImageView alloc] initWithFrame:CGRectMake(276.0, 375.0, 39.0, 36.0)];
imgCam.image = [UIImage imageNamed:@"camera_icon.png"];
[self.view addSubview:imgCam];
if([stories count] == 0) {
[self parseXMLFileAtURL:@"http://iphone.concentra.exuvis.com/feed/rss/article/2/binnenland.xml"];
cellSize = CGSizeMake([myTable bounds].size.width,60);
- (IBAction)buttonPressed:(id)sender {
lbl.text = ((UIButton*)sender).currentTitle;
- (IBAction)buttonClicked:(id)sender {
lbl.text = ((UIButton*)sender).currentTitle;
- (IBAction)buttonTouched:(id)sender {
lbl.text = ((UIButton*)sender).currentTitle;
-(void)buttonBinn:(id)sender
[rubic setBackgroundImage:[UIImage imageNamed:@"MOUSEOVER.png"] forState:UIControlStateNormal];
[buurt setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
[beeld setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
-(void)buttonBuurt:(id)sender
[buurt setBackgroundImage:[UIImage imageNamed:@"MOUSEOVER.png"] forState:UIControlStateNormal];
[beeld setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
[rubic setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
-(void)buttonBeeld:(id)sender
[beeld setBackgroundImage:[UIImage imageNamed:@"MOUSEOVER.png"] forState:UIControlStateNormal];
[rubic setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
[buurt setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
// Release anything that's not essential, such as cached data
- (void)dealloc {
[myTable release];
[detailViewController release];
[super dealloc];
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return [stories count];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GVAiPhone"];
if (cell == nil) {
//CGRect cellFrame = CGRectMake(0, 0, 300, 65);
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"GVAiPhone"] autorelease];
//cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
//cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow_icon.png"]];
CGRect nameValueRect = CGRectMake(5, 5, 275, 35);
UILabel *nameValue = [[UILabel alloc] initWithFrame:nameValueRect];
nameValue.tag = kNameValueTag;
nameValue.font = [UIFont fontWithName:@"Arial" size:15.0];
nameValue.lineBreakMode = UILineBreakModeWordWrap;
nameValue.numberOfLines = 2;
[cell.contentView addSubview:nameValue];
[nameValue release];
CGRect colorValueRect = CGRectMake(5, 38, 275, 65);
UILabel *colorValue = [[UILabel alloc] initWithFrame:colorValueRect];
colorValue.tag = kColorValueTag;
colorValue.font = [UIFont fontWithName:@"Arial" size:11.0];
colorValue.textColor = [UIColor colorWithRed:130.0/255.0 green:135.0/255.0 blue:139.0/255.0 alpha:1.0];
colorValue.lineBreakMode = UILineBreakModeWordWrap;
colorValue.textAlignment = UITextAlignmentLeft;
colorValue.numberOfLines = 6;
[cell.contentView addSubview:colorValue];
[colorValue release];
// Set up the cell
//cell.text = [theSimpsons objectAtIndex:indexPath.row];
//cell.hidesAccessoryWhenEditing = YES;
NSUInteger storyIndex = [indexPath row];
NSDictionary *rowData = [stories objectAtIndex:storyIndex];
UILabel *name = (UILabel *)[cell.contentView viewWithTag:kNameValueTag];
name.text = [rowData objectForKey:@"title"];
//name.lineBreakMode;
//UIImage *image =[UIImage imageNamed: currentImage];imageWithContentsOfFile
//image.size.width = 50;
//iimage.size.height = 50;
//cell.image = [UIImage imageNamed:currentImage];
cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow_icon.png"]];
UILabel *color = (UILabel *)[cell.contentView viewWithTag:kColorValueTag];
color.text = [rowData objectForKey:@"summary"];
return cell;
@end
- here the actual problem is the xml node <enclosure> contains images but in using the method "didEndElement" , it doesn't parse into the <enclosure> node. ya so please help me in parsing and getting the image.
Waiting for your help !!
-SathiyaHi, how did you solve your problem in detail. I'm having the same problem with this rss-feed: www.spiegel.de/index.rss
I cannot parse the url of the images. I'm looking forward to your answer. -
How to fetch presence in Lync 2013 from SQL server (using query)
We are running Lync 2013 setup with 5 FE and 2 BE SQL (mirrored) servers.
How can i get presence information for our users by script or SQL queries?
My Concern is to fetch out current presence information of a list of users (CSV file) by script (Powershell or SQL query) for automation purpose. So that one need not to go to Lync 2013 (or anything) Client for every single user, to check their corresponding
presence.
E.g Say a service desk agent is handling tickets of 200 users per day. So it will be time consuming for him/her to go to Lync 2013 client and check presence for every user. It would be better for SD agent to operate, if we could make a script to fetch presence
status for the list of 200 users.
We will fetch the information when required and send a mail to him/her.
i have asked this question under Presence and IM forum.
https://social.technet.microsoft.com/Forums/en-US/ef6287d1-e474-48ab-a411-f3813d256145/how-to-fetch-presence-information-in-lync-2013?forum=lyncprofile
been suggested to post it here.Create a Store procedure which will give you integer value according to presence status:
USE [rtc]
GO
/****** Object: StoredProcedure [dbo].[GetAvailability] Script Date: 05/01/2015 10:36:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <sudipta samanta>
-- Create date: <02.01.2015>
-- Description: <fetch presence information of user>
-- =============================================
CREATE PROCEDURE [dbo].[GetAvailability]
@_Publisher varchar(50)
AS
DECLARE
@agrregate_state varchar(500),
@availability varchar(50),
@index_first int,
@index_last int,
@index int
BEGIN
SET NoCount ON
set @agrregate_state = (select top 1 Data from dbo.DiagPublisherDataView(@_Publisher) order by LastPubTime desc);
set @index_first = (select CHARINDEX('<availability>',@agrregate_state));
set @index_last = (select CHARINDEX('</availability>',@agrregate_state));
set @index = @index_first + 14;
set @availability = (SUBSTRING(@agrregate_state,@index,@index_last - @index));
return CONVERT(int, @availability);
END
GO -
Extracting attributes from XML document using plsql
Hello,
I have successfully written a plsql procedure that has been
using Xpath to extract the element values from an XML doument:
i.e.
l_xpath := '/Form_Data/Person_Details/Initials';
l_DomNodeList := xslprocessor.SelectNodes(l_RootNode, l_xpath);
l_DomNode := xmldom.item(l_DomNodeList,0); -- first Element
l_DomNode := xmldom.getfirstchild(l_DomNode);
l_id_number := xmldom.getNodeValue(l_DomNode);
However the data (Initials) I wish to extract is now stored as
attributes within the Person_Details element and I was wondering
how I would go about explicitly extracting the attributes values!
I have not been able to find any examples, although I have been
pointed in the direction of xmldom.getattribute without any
success!
Any help, or code examples greatly appreciated,
- Mark...example:-
xpath.VALUEOF(i_doc,v_PricingPath||'@LockIndicator'); -
How to read from xml documents using either sax or dom
dear all
i have an xml document and i want to create a procedure to read the data from it .
is it possible or not? thanks in advanceWhere is the xml document located?
load it into an XMLTYPE and apply xpath as required.
SQL> declare
2 xml xmltype ;
3 begin
4 xml := xmltype('<node><value>this is text</value></node>') ;
5 dbms_output.put_line('value='||xml.extract('/node/value/text()').getStringVal()) ;
6 end ;
7 /
value=this is text
PL/SQL procedure successfully completed.
SQL> -
Reading from XML file using DOM parser.
Hi,
I have written the following java code to read the XML file and print the values. It reads the XML file. It gets the node NAME and prints it. But it returns null when trying to get the node VALUE. I am unable to figure out why.
Can anyone please help me with this.
Thanks and Regards,
Shweta
import java.io.*;
import java.net.*;
import java.util.*;
import oracle.xml.parser.v2.*;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
public class ReadNodes
private static XMLDocument mDoc;
public ReadNodes () {
try {
DOMParser lParser = new DOMParser();
URL lUrl = createURL("mot.xml");
System.out.println("after creating the URL object ");
lParser.setErrorStream(System.out);
lParser.showWarnings(true);
lParser.parse(lUrl);
mDoc = lParser.getDocument();
System.out.println("after creating the URL object "+mDoc);
lParser.reset();
} catch (Exception e) {
e.printStackTrace();
} // end catch block
} // End of constructor
public void read() throws DOMException {
try {
NodeList lTrans = this.mDoc.getElementsByTagName("TRANSLATION");
for(int i=0;i<lTrans.getLength();i++) {
NodeList lTrans1 = lTrans.item(i).getChildNodes();
System.out.println("lTrans1.item(0).getNodeName : " + lTrans1.item(0).getNodeName());
System.out.println("lTrans1.item(0).getNodeValue : " + lTrans1.item(0).getNodeValue());
System.out.println("lTrans1.item(1).getNodeName : " + lTrans1.item(1).getNodeName());
System.out.println("lTrans1.item(1).getNodeValue : " + lTrans1.item(1).getNodeValue());
} catch (Exception e) {
System.out.println("Exception "+e);
e.printStackTrace();
} catch (Throwable t) {
System.out.println("Exception "+t);
public static URL createURL(String pFileName) throws MalformedURLException {
URL url = null;
try {
url = new URL(pFileName);
} catch (MalformedURLException ex) {
File f = new File(pFileName);
String path = f.getAbsolutePath();
String fs = System.getProperty("file.separator");
System.out.println(" path of file : "+path +"separator " +fs);
if (fs.length() == 1) {
char sep = fs.charAt(0);
if (sep != '/')
path = path.replace(sep, '/');
if (path.charAt(0) != '/')
path = '/' + path;
path = "file://" + path;
System.out.println("path is : "+path);
// Try again, if this throws an exception we just raise it up
url = new URL(path);
} // End catch block
return url;
} // end method create URL
public static void main (String args[]) {
ReadNodes mXML = new ReadNodes();
mXML.read();
The XML file that I am using is
<?xml version = "1.0"?>
<DOCUMENT>
<LANGUAGE_TRANS>
<TRANSLATION>
<CODE>3</CODE>
<VALUE>Please select a number</VALUE>
</TRANSLATION>
<TRANSLATION>
<CODE>5</CODE>
<VALUE>Patni</VALUE>
</TRANSLATION>
<TRANSLATION>
<CODE>6</CODE>
<VALUE>Status Messages</VALUE>
</TRANSLATION>
<TRANSLATION>
<CODE>7</CODE>
<VALUE>Progress</VALUE>
</TRANSLATION>
<TRANSLATION>
<CODE>8</CODE>
<VALUE>Create Data Files...</VALUE>
</TRANSLATION>
<TRANSLATION>
<CODE>9</CODE>
<VALUE>OK</VALUE>
</TRANSLATION>
</LANGUAGE_TRANS>
</DOCUMENT>because what you want is not the node value of CODE but the node value of the text nodes into it!
assuming only one text node into it, try this:
System.out.println("lTrans1.item(0).getNodeName : " + lTrans1.item(0).getFirstChild().getNodeValue());
Maybe you are looking for
-
I'm using pages 5 and want to comment in a right hand column, on a (latin) text which I wish to place in a left hand column. Ideally I'd like to be able to copy and paste the latin text and see it flow over into the left hand column on multiple pages
-
Is there an accessory cable to record calls?
I work for a newspaper and sometimes record telephone interviews. It's helpful if I get to a crucial place in my notes that I can't read because I was writing too fast. It happens. My deskphone has a little wire coming out the back with a 1/8 inch mo
-
Hi I would like to trap the standard ALV toolbar events of ALV like APPEND ROWS etc.I am doing through the ABAP objects. Please let me have procedure that. Thanking you in advance. Satyajit
-
Asp onLoad not working in Browser
I have an interesting problem. I have access to an existing asp code(store locator) that I can access with a URL here: http://www.marshallsonline.com/xml.asp?zip=02210&dept=cub where zip is the zipcode and dept is optional. this returns the three clo
-
Wlw-manifest.xml file missing con:conversation-state-table entries
Hello, (cross-posted from weblogic.developer.interest.jndi) I am using WebLogic 8.1.4 (WLI 8.5). When our wlw-manifest.xml file is generated, it is MISSING all the <con:conversation-state-table> tags which typically contain the name of the database t