tolower and toupper  concat

Chapter 2: XML Services

normalize-space

Description

Makes two changes when it returns its argument value:

Syntax

normalize-space(string-parameter)

Examples

This example applies normalize-space to a parameter that includes leading and trailing spaces, and embedded newline and tab characters:

select xmlextract
('normalize-space(" Normalize  space   example. ")', text_doc)
from sample_docs where name_doc='bookstore'
------------------------
Normalize space example.

normalize-space and tolower or toupper are useful in XPath predicates, when you are testing values whose use of white space and case is not known. The following predicate is unaffected by the case and whitespace usage in the title elements:

select xmlextract
('//magazine[normalize-space(tolower(title)="tracking trenton")]//price', 
text_doc)
from sample_docs where name_doc='bookstore'
--------------------------
<price>55</price>




Copyright © 2004. Sybase Inc. All rights reserved. concat

View this book as PDF