NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
C-15
Examples—Character Expressions
sorts as string of u and e \d223 "<s><s>" # sharp-s sorts as string of s and s \d163
\d163 # upper-half specials and controls \d215 \d215 # multiply sign \d159 \d159
\d170 \d170 \d186 \d186 UNDEFINED IGNORE order_end END LC_COLLATE
LC_CTYPE charclass alphas; numerics; hexdigits; specials alphas <A>;...;<Z>;\
<a>;...;<z>;\ \d192;...;\d214;\d216;...;\d246;\d248;...;\d255 numerics
<0>;<1>;\d050;\x33;\ <4>;...;<9> hexdigits <0>;...;<9>;\ <a>;...;<f>;\ <A>;...;<F>;
specials toupper (<a>,<A>);(<b>,<B>);(<c>,<C>);(<d>,<D>);(<e>,<E>);\
(<f>,<F>);(<g>,<G>);(<h>,<H>);(<i>,<I>);(<j>,<J>);\
(<k>,<K>);(<l>,<L>);(<m>,<M>);(<n>,<N>);(<o>,<O>);\
(<p>,<P>);(<q>,<Q>);(<r>,<R>);(<s>,<S>);(<t>,<T>);\
(<u>,<U>);(<v>,<V>);(<w>,<W>);(<x>,<X>);(<y>,<Y>);\
(<z>,<Z>);(\d224,\d065);(\d225,\d065);(\d226,\d065);\
(\d227,\d195);(\d231,\d199);(\d236,\d073);\
(\d237,\d073);(\d238,\d073);(\d239,\d073);\
(\d241,\d209);(\d242,\d079);(\d243,\d079);\
(\d244,\d079);(\d245,\d213);(\d249,\d085);\
(\d250,\d085);(\d251,\d085);(\d255,\d089);\
(\d229,\d197);(\d248,\d216);(\d230,\d198);\
(\d254,\d222);(\d228,\d196);(\d246,\d214);\ (\d252,\d220) END LC_CTYPE
LC_TDMCODESET ISO88591 END LC_TDMCODESET Collations on
page C-38.
Examples—Character Expressions
The following concatenation results in “Robert Smith”:
"Robert " || "Smith"
Note that the blanks between names are included in the original string literals.
The next example results in “Robert John Smith”:
"Robert " || "John " || "Smith"
The following example concatenates “Robert” with a string of length 0, which
results in “Robert”:
"Robert" || ""
The following example results in “Robert SMITH”:
"Robert " || UPSHIFT ("Smith")
The next example results in “Robert Smith” with the collating sequence FRENCH:
"Robert " COLLATE FRENCH || "Smith"
The following SELECT statement returns a null value because one of the two
character string operands has a null value:
>>CREATE TABLE EMPNAME (first_name char(10),
+> last_name char(10));
>>INSERT INTO EMPNAME VALUES ("Robert ", NULL);
>>SELECT ( first_name || last_name ) FROM EMPNAME;