PreviousSQL Engine Reference (v10) Next

CASE (string)

Chapter contents

Remarks

The CASE keyword causes Pervasive PSQL to ignore case when evaluating restriction clauses involving a string column. CASE can be specified as a column attribute in a CREATE TABLE or ALTER TABLE statement, or in an ORDER BY clause of a SELECT statement.

For example, suppose you have a column called Name that is defined with the CASE attribute. If you insert two rows with Name = `Smith' and Name = `SMITH,' a query with a restriction specifying Name = `smith' correctly returns both rows.


Note
CASE (string) does not support multiple-byte character strings. The keyword assumes that the string data is single-byte ASCII. The string functions do support multiple-byte character strings. See String Functions .

Examples

The following example shows how you add a column to the Student table with the CASE keyword.

ALTER TABLE Student ADD Name char(64) CASE 

The following example shows how to use CASE in an ORDER BY clause of a SELECT statement.

SELECT Id, Last_Name+', '+First_Name AS Whole_Name, 
Phone FROM Person ORDER BY Whole_Name CASE 

See Also

ALTER TABLE

CREATE TABLE

SELECT


Chapter contents
Book contents

Prev topic: CASE (expression)
Next topic: CLOSE