You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

There also exist algebraic operators (+,  -, *, /) to perform string concatenation and deletion.

 

Example
SELECT "Hello"+"World" FROM Stream
=> "HelloWorld"
SELECT "HelloWorld"-"World" FROM Stream
=> "Hello"
SELECT "HelloWorld"*3 FROM Stream
=> "HelloWorldHelloWorldHelloWorld"
SELECT "HelloWorldHelloWorldHelloWorld"/"World" FROM Stream
=> 3

Concat(String, String)

Returns a new string that is a concatenating the arguments.

SubString(String, Number, Number)

Returns a new string that is a substring of the value with given begin and end index

Example
SELECT substring("Hello World",1,3) FROM Stream
=> "el"

Length(String)

Returns the length of a string.

Example
SELECT length("Hello") FROM Stream
=> 5

Upper(String)

Returns the string converted to uppercase.
 

Example
SELECT upper("Hello World") FROM Stream
=> "HELLO WORLD"

Lower(String)

Returns the string converted to lowercase.

Example
SELECT lower("Hello World") FROM Stream
=> "hello world"

Parsing of Strings

The most functions provide one return value. Sometimes it is needed to split an incoming attribute to multiple values

split(String,String,Number)

This function returns number (third parameter) strings from the input string (first parameter) with the delimiter (second parameter).

SELECT split(input,",",3) FROM stream

Remark: There is no way to parse different types with this function. Each incoming string must contains exactly the given numbers of inputs.

  • No labels