Re: SQLXML and column name with hypen ('-')

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: raju (raju_at_discussions.microsoft.com)
Date: 12/30/04


Date: Thu, 30 Dec 2004 06:53:01 -0800

Adding sql:field solves the problem. As I get the schema (below mentioned
one) from an external system, I need to modify it on my side to solve
problems like this one. It will be better if you guys fix this issue in the
next patch.

"Michael Rys [MSFT]" wrote:

> I think the issue is that names are not automatically "quoted" on the SQL
> side and thus you get an invalid SQL statement generated.
>
> Try:
>
> <xs:element name="appraisalOrAVMOrHUD-1Date"
> type="xs:date" minOccurs="0" sql:field="[appraisalOrAVMOrHUD-1Date]"/>
>
> I will forward this to the dev team to see if they can do the quoting per
> default or whether there is a reason not to....
>
> Best regards
> Michael
>
> ..
>
>
> "raju" <raju@discussions.microsoft.com> wrote in message
> news:A0065FF9-7258-4064-83D0-2D182BDE3946@microsoft.com...
> > Hi Michael,
> >
> > First of all my problem is column name with hypen. For example if
> > [my-table] has a column which has got hypen in it is name, SQLXML blows
> > with
> > the below mentioned error message. Below is my actual xml file with
> > sql:relation etc..
> > ---------
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > elementFormDefault="qualified"
> > xmlns:qrm="http://www.qrm.com/2003/PoolExport"
> > xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
> > <xs:element name="assetList" sql:relation="assetList">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element name="asset" maxOccurs="unbounded"
> > sql:relation="asset"
> > sql:relationship="assetList_asset">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element name="Appraisal" sql:relation="Appraisal"
> > sql:relationship="assetList_asset_Appraisal">
> > <xs:complexType>
> > <xs:all>
> > <xs:element name="propertyValuation"
> > qrm:ReferredByMapping="1" sql:relation="propertyValuation"
> > sql:relationship="assetList_asset_Appraisal_propertyValuation">
> > <xs:complexType>
> > <xs:all>
> > <xs:element name="appraisalOrAVMOrHUD-1Date"
> > type="xs:date" minOccurs="0" />
> > </xs:all>
> > </xs:complexType>
> > </xs:element>
> > </xs:all>
> > </xs:complexType>
> > </xs:element>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > <xs:annotation>
> > <xs:appinfo>
> > <sql:relationship name="assetList_asset" parent="assetList"
> > parent-key="[_MapID] " child="asset"
> > child-key="[_bd53f2c4_58f8_485c_80d1_46bd667a1159] " />
> > <sql:relationship name="assetList_asset_Appraisal" parent="asset"
> > parent-key="[_MapID] " child="Appraisal"
> > child-key="[_74d6a9f4_e9cf_47cb_a18a_b4d0eff6ddf3] " />
> > <sql:relationship name="assetList_asset_Appraisal_propertyValuation"
> > parent="Appraisal"
> > parent-key="[_MapID] " child="propertyValuation"
> > child-key="[_f4edca6c_53d8_4158_b398_80cbaa3805ca] " />
> > </xs:appinfo>
> > </xs:annotation>
> > </xs:schema>
> > --------
> >
> > If you look at the propertyValuation in the above xml, it has got a
> > sub-element "appraisalOrAVMOrHUD-1Date" which is giving all the troubles.
> > If
> > I remove the hypen, it works without any problem.
> >
> > Thanks
> > Raju
> >
> > "Michael Rys [MSFT]" wrote:
> >
> >> Where are you using the name? As a value for an annotation? If so, did
> >> you
> >> quote the name (e.g., sql:relation="[my-table]")?
> >>
> >> Best regards
> >> Michael
> >>
> >> "raju" <raju@discussions.microsoft.com> wrote in message
> >> news:E338E821-EA33-4492-A51F-82F6F8A74EC2@microsoft.com...
> >> >I am getting "Invalid value for 'column' in my-table name" error
> >> >message.
> >> >
> >> > "Michael Rys [MSFT]" wrote:
> >> >
> >> >> Could you please provide us with some more information about what
> >> >> failures
> >> >> you are seeing? Error messages? No data? Incorrect data?
> >> >>
> >> >> Thanks
> >> >> Michael
> >> >>
> >> >> "raju" <raju@discussions.microsoft.com> wrote in message
> >> >> news:ECCDD589-B8F9-4443-A992-AC29B71A358F@microsoft.com...
> >> >> > Is there a known issue with SQLXML and column names with hypen. I
> >> >> > am
> >> >> > using
> >> >> > SQLXML to generate xml documents for a B2B application. My xml
> >> >> > generation
> >> >> > fails if any of the tables that are involved in the xml generation
> >> >> > process
> >> >> > contains hypens ('-') in their column names
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>



Relevant Pages

  • Re: XML Modification
    ... I'd like to allow a user (not tech savvy) to modify certain values on ... an XML file. ... I may be missing something, but it seems that you only to read the file in, parse the xml and add or change nodes and values. ...
    (comp.lang.java.help)
  • Re: Inetpub
    ... all the IIS settings are now stored in an ... You should be able to simply modify the XML file with the new ... I need to move the Inetpub in the C Drive to D ...
    (microsoft.public.exchange.admin)
  • Re: Code Group Security policy deployment
    ... > Don't try to modify these files manually. ... >> Use of included script samples are subject to the terms specified at ...
    (microsoft.public.dotnet.security)
  • Re: Modifying data in complex type
    ... Michael, ... syntax incorrect somewhere, or my predicates weren't correct, or something. ... >> modify() ... >>> update the old tree with the new one. ...
    (microsoft.public.sqlserver.xml)
  • >> Very Simple PHP DOM Question..Please help!
    ... I need to the DOM to modify an XML ... DOM PHP 5 functions, but I cannot get it quite right. ... how to modify the XML file as above, ...
    (comp.lang.php)