|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how sql xml query to get empty element tagI want to generate empty data tag, for example, the table1 has 2 fileds called field1 and field2, the field1 has data there but field2 no data, when creating xml fiel using query: select field1, field2 from table1 for xml auto, elements it creates xml file without empty elment tag like this: <Table1> <field1> 23 <field1> </Table1> But I want field2 xml tag <field2 /> show in the file like <Table1> <field1> 23 <field1> <field2 /> </Table1> That means <field2 /> tell no data, but I want the xml tag display in the file. can anyone know how to generate empty data xml tag using above sql xml query or another solution? Thanks in advance Martin The problem is the NULL values of the fields.
You should update first the null Values to ‘’ for example: <<< UPDATE DETALHES SET TEXTO = '' WHERE TEXTO IS NULL >>> and then your query will result!DanyR Show quoteHide quote "martin1" wrote: > Hi, All, > > I want to generate empty data tag, for example, the table1 has 2 fileds > called field1 and field2, the field1 has data there but field2 no data, when > creating xml fiel using query: > > select field1, field2 from table1 for xml auto, elements > > it creates xml file without empty elment tag like this: > > <Table1> > <field1> 23 <field1> > </Table1> > > But I want field2 xml tag <field2 /> show in the file like > > <Table1> > <field1> 23 <field1> > <field2 /> > </Table1> > > That means <field2 /> tell no data, but I want the xml tag display in the > file. > can anyone know how to generate empty data xml tag using above sql xml query > or another solution? > > Thanks in advance > Martin >
Read and write database
Help - Timing Logic Datagridview...cell contents Unable to write to file in my web site Serial ports. Attaching multiple files of any type to a mail message? [OT] VB.Net and MS Access Why does Join method call sit there forever? communicate with Activesync? Can it be done? Adding Dropdownlist to GridView |
|||||||||||||||||||||||