Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Mon, 2 Jun 2008 11:36:01 -0700,    group: microsoft.public.xml        back       


Change datatype in XML   
We have an ASP file written in VB script, which connects to Oracle via 
Microsoft OLEDB Provider for Oracle (Provider=MSDAORA.1).  

Set objCmd = Server.CreateObject("ADODB.Command")
Set objRs = Server.CreateObject("ADODB.RecordSet")

'Code here to asign connection string, parameters for Oracle stored 
procedure to objCmd

Set objRs = objCmd.Execute
Response.ContentType = "text/xml"
objRs.Save Response ,adPersistXML

The XML file has one of the data members like this (Oracle 10g):

<s:AttributeType name="G21" rs:number="21" rs:nullable="true" 
rs:writeunknown="true">
  <s:datatype dt:type="float" dt:maxLength="8" rs:precision="15" 
rs:fixedlength="true" /> 
  </s:AttributeType>

However, it retruned as below when Oracle was 9i:

<s:AttributeType name="G21" rs:number="21" rs:nullable="true" 
rs:writeunknown="true">
  <s:datatype dt:type="number" rs:dbtype="varnumeric" dt:maxLength="20" 
rs:scale="0" rs:precision="38" /> 
  </s:AttributeType>

There is no datatype and stored procedure change on Oracle side.  Why do we 
get diffrent datatype in ASP?  Is there any impact on data?  Is it possible 
to change the data attribute back to NUMBER in the ASP after the call to 
Oracle stored procedure?  If it is, how?
date: Mon, 2 Jun 2008 11:36:01 -0700   author:   VBcode

Re: Change datatype in XML   
"VBcode"  wrote in message 
news:229AB529-D1AD-49D8-B814-9BACA5377794@microsoft.com...
> We have an ASP file written in VB script, which connects to Oracle via
> Microsoft OLEDB Provider for Oracle (Provider=MSDAORA.1).
>
> Set objCmd = Server.CreateObject("ADODB.Command")
> Set objRs = Server.CreateObject("ADODB.RecordSet")
>
> 'Code here to asign connection string, parameters for Oracle stored
> procedure to objCmd
>
> Set objRs = objCmd.Execute
> Response.ContentType = "text/xml"
> objRs.Save Response ,adPersistXML
>
> The XML file has one of the data members like this (Oracle 10g):
>
> <s:AttributeType name="G21" rs:number="21" rs:nullable="true"
> rs:writeunknown="true">
>  <s:datatype dt:type="float" dt:maxLength="8" rs:precision="15"
> rs:fixedlength="true" />
>  </s:AttributeType>
>
> However, it retruned as below when Oracle was 9i:
>
> <s:AttributeType name="G21" rs:number="21" rs:nullable="true"
> rs:writeunknown="true">
>  <s:datatype dt:type="number" rs:dbtype="varnumeric" dt:maxLength="20"
> rs:scale="0" rs:precision="38" />
>  </s:AttributeType>
>
> There is no datatype and stored procedure change on Oracle side.  Why do 
> we
> get diffrent datatype in ASP?  Is there any impact on data?  Is it 
> possible
> to change the data attribute back to NUMBER in the ASP after the call to
> Oracle stored procedure?  If it is, how?

I don't see that this is any of ASP's doing, looks like underlying table has 
changed (although you say it hasn't).
If you have to have the same return type then it appears you have two 
options:
1) Wrap the Oracle procedure in one that runs the new one but casts the 
particular field to the older type
2) Transform the XML, via XSLT perhaps



-- 

Joe Fawcett (MVP - XML)

http://joe.fawcett.name
date: Tue, 3 Jun 2008 08:10:59 +0100   author:   Joe Fawcett am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us