How to retrive - CreateDateStamp="2006-02-14T10:30:16.0Z" value [message #163496] |
Thu, 16 March 2006 22:34 |
askshirsagar
Messages: 9 Registered: February 2006 Location: India
|
Junior Member |
|
|
I am able to extract value of all attributes/nodes but I do not know the logic to retrive CreateDateStamp and
LastModifiedDateStamp <Organisation CreateDateStamp="2006-02-14T10:30:16.0Z" LastModifiedDateStamp="2006-02-14T10:30:16.0Z">
Please let me know if any one knows it.
Many thanks for your help.
Rgds,
Avinash
DECLARE
x XMLTYPE := XMLTYPE('
<Organisations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.oracle.com/Organisations.xsd"
CreateDateStamp="2006-02-14T11:49:17.0Z" LastModifiedDateStamp="2006-02-14T11:49:17.0Z">
<Organisation CreateDateStamp="2006-02-14T10:30:16.0Z" LastModifiedDateStamp="2006-02-14T10:30:16.0Z">
<SourceSystem>Maconomy</SourceSystem>
<OrganisationName>WARMWELL HOMES LTD</OrganisationName>
<OrganisationType>Ltd</OrganisationType>
<OrganisationAddresses>
<OrganisationAddress>
<Address>
SourceSystem>Maconomy</SourceSystem>
<OrganisationName></OrganisationName>
<DepartmentName></DepartmentName>
<SubBuildingName></SubBuildingName>
<BuildingName></BuildingName>
<BuildingNumber>1</BuildingNumber>
<DependentThoroughFareName></DependentThoroughFareName>
<DependentThoroughFareDescriptor></DependentThoroughFareDescriptor>
<DoubleDependentLocality></DoubleDependentLocality>
<ThoroughFareName></ThoroughFareName>
<ThoroughFareDescriptor>DANESBURY PARK</ThoroughFareDescriptor>
<LocalityElements></LocalityElements>
<DependentLocality></DependentLocality>
<PostTown>HERTFORD</PostTown>
<County></County>
<POBoxDetails></POBoxDetails>
<PostCode>SG14 3HX</PostCode>
<AddressAdditionalInfo></AddressAdditionalInfo>
</Address>
</Organisation>
</Organisations>');
BEGIN
FOR i IN ( SELECT
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationName') T_OrganisationName,
EXTRACTVALUE(VALUE(t), '/Organisation/SourceSystem') T_SourceSystem,
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationRegNo') T_OrganisationRegNo,
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationType') T_OrganisationType,
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationVatNo') T_OrganisationVatNo,
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationTradingNames/OrganisationTradingName') T_OrganisationTradingName,
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationAddresses/OrganisationAddress/AddressType') AddressType,
EXTRACT(VALUE(t), '/Organisation/OrganisationAddresses/OrganisationAddress/Contacts/Contact') Contact_xml
FROM TABLE(XMLSEQUENCE(EXTRACT(x, '/Organisations/Organisation'))) t )
LOOP
DBMS_OUTPUT.PUT_LINE('Address Type ' || i.AddressType);
END LOOP;
END;
|
|
|
|
|