Showing posts with label words. Show all posts
Showing posts with label words. Show all posts

Friday, March 23, 2012

How can i output XQuery's key words such like "<,>" when using XQuery in SQL Se

in SQL Server 2005, I have a codes like this:

declare @.zz varchar(1000)
declare @.x xml
set @.x = '
<root>
<billID>1122</billID>
</root>'

select @.x.query('
for $bi in //billID/text()
return ">"
')

it runs, but it prints "&gt;" not ">", I know maybe "<,>" are keys words in XQuery, but how can i output them?

someone told me to use "\", but it doesn't work.

I used Stylus Studio, it prints ">", very well http://www.stylusstudio.com/xml_download.html

but why Microsoft can't ?

Help please

Do you want it to be in an XML document that can be reparsed? then the serialization will most likely generate &gt; (as you noticed we do). If you load the XML document that contains &gt; into the IE renderer, you will notice that it will show > instead (but you could not reparse the document).

If you want to get a string value for further string processing, you need to cast the XML value to a string type... for example:

declare @.x xml

set @.x = '<root><billID>1122</billID></root>'

select (@.x.query('for $bi in //billID/text()
return ">"
')).value('text()[1]', 'nvarchar(10)')

I hope this helps
Michael

|||

hi, thanks buddy, it's so helpful, thanks so much

But I have already found another way to solve my problem, to use replace in select.. like this:

declare @.x xml
set @.x = '
<root>
<billID>1122</billID>
</root>'

select replace(convert(varchar(1000),@.x.query('
for $bi in //billID/text()
return ">"
')),'&gt;','>')

I used replace ... convert ... , thus replace all the "&gt;" as ">",, nit very smart , but it works

anyway, ur way is the best one, I like it...

Thanks

sql

How can i output XQuery's key words such like "<,>" when using XQuery in SQ

in SQL Server 2005, I have a codes like this:

declare @.zz varchar(1000)
declare @.x xml
set @.x = '
<root>
<billID>1122</billID>
</root>'

select @.x.query('
for $bi in //billID/text()
return ">"
')

it runs, but it prints "&gt;" not ">", I know maybe "<,>" are keys words in XQuery, but how can i output them?

someone told me to use "\", but it doesn't work.

I used Stylus Studio, it prints ">", very well http://www.stylusstudio.com/xml_download.html

but why Microsoft can't ?

Help please

Do you want it to be in an XML document that can be reparsed? then the serialization will most likely generate &gt; (as you noticed we do). If you load the XML document that contains &gt; into the IE renderer, you will notice that it will show > instead (but you could not reparse the document).

If you want to get a string value for further string processing, you need to cast the XML value to a string type... for example:

declare @.x xml

set @.x = '<root><billID>1122</billID></root>'

select (@.x.query('for $bi in //billID/text()
return ">"
')).value('text()[1]', 'nvarchar(10)')

I hope this helps
Michael

|||

hi, thanks buddy, it's so helpful, thanks so much

But I have already found another way to solve my problem, to use replace in select.. like this:

declare @.x xml
set @.x = '
<root>
<billID>1122</billID>
</root>'

select replace(convert(varchar(1000),@.x.query('
for $bi in //billID/text()
return ">"
')),'&gt;','>')

I used replace ... convert ... , thus replace all the "&gt;" as ">",, nit very smart , but it works

anyway, ur way is the best one, I like it...

Thanks

Monday, February 27, 2012

How can I get the keyword list indexed by SQL Server 2005

Full Text search must keep a list of key words or items somewhere.

How can I get access to this list to present to a user.

For example: show me all indexed words starting with letter a* and then ac*.

I'm trying to find this information without success.

Full Text uses only predicates so what you are asking are actually noise word and you can find the noise words for supported languages in the location below in your C drive. Hope this helps.

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData

|||

As far as I know there is no way built in way to get the list from fulltext service as the data is stored natively by FTS.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Friday, February 24, 2012

How can I get digit into words in crystal report

Hi Everybody
How can I get digit into words in crystal report...
for examble
"102" in to
"hundred and two"
By RajeshHi Rajesh,

I think this code will work for you.

Function (currencyVar v1)
Local CurrencyVar RoundCents := round(remainder(v1,1)*100);
Local Stringvar Dollarpart := towords(int(v1),0);
Local Stringvar Centspart := towords(int(RoundCents),0);
if instr(dollarpart, "hundred") > 0
then dollarpart := Replace (dollarpart,"hundred" ,"hundred and" );
dollarpart + " dollars and " + centspart + " cents"