Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Data Types and Expressions > Expression >

Using Subscripts on Character Columns

You can use subscripts on CHAR, VARCHAR, NCHAR, NVARCHAR, LVARCHAR, BYTE, and TEXT columns. The subscripts indicate the starting and ending character positions in the expression. Together the column subscripts define a column substring as the portion of the column that is contained in the expression.

For example, if a value in the lname column of the customer table is Greenburg, the following expression evaluates to burg:

lname[6,9]

A conditional expression can include a column expression that uses the substring operator ( [ first, last ] ), as in the following example:

SELECT lname FROM customer WHERE phone[5,7] = '356';

Here the quotes are required, to prevent the database server from applying a numeric filter to the digits in the criterion value.

For information on the GLS aspects of column subscripts and substrings, see the IBM Informix GLS User's Guide.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]