23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LENGTH<br />

Notes • string_exp can be fixed-length or variable-length CHARACTER data types.<br />

LENGTH<br />

Syntax<br />

102<br />

• count can be INTEGER, SMALLINT, or TINYINT data types.<br />

• If any of the arguments of the expression evaluate to NULL, the result is NULL.<br />

• If the count is negative, the result evaluates to NULL.<br />

• The string_exp and the result can contain multi-byte characters. The function returns the<br />

number of characters.<br />

Compatibility<br />

ODBC compatible<br />

Returns the string length of the value of the given character expression.<br />

Example This example illustrates the LENGTH function:<br />

Notes • The argument to the function must be of type CHARACTER or VARCHAR.<br />

LOCATE<br />

LENGTH ( char_expression )<br />

SELECT last_name 'LONG LAST_NAME'<br />

FROM customer<br />

WHERE LENGTH (last_name) > 5 ;<br />

• The result is of type INTEGER.<br />

• If the argument expression evaluates to NULL, the result is NULL.<br />

• char_expression can contain multi-byte characters. The function returns a number of<br />

characters.<br />

Compatibility<br />

ODBC compatible<br />

Returns the location of the first occurrence of char_expr1 in char_expr2. If the function<br />

includes the optional integer argument start_pos, LOCATE begins searching char_expr2 at that<br />

position. If the function omits the start_pos argument, LOCATE begins its search at the<br />

beginning of char_expr2.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!