Search for String Across Columns : VARCHAR2 « SQL Data Types « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE TABLE myRoom
  2  (name   VARCHAR(10)
  3  ,floorcolor VARCHAR(10)
  4  ,ceilingcolor VARCHAR(10)
  5  ,wallcolor VARCHAR(10)
  6  );

Table created.

SQL> INSERT INTO myRoom VALUES ('Jim','RED','GREEN','YELLOW');

1 row created.

SQL> INSERT INTO myRoom VALUES ('Bob','YELLOW','BLUE','BLACK');

1 row created.

SQL> INSERT INTO myRoom VALUES ('Allan','BLUE','PINK','BLACK');

1 row created.

SQL> INSERT INTO myRoom VALUES ('George','BLUE','GREEN','OAK');

1 row created.

SQL>
SQL> SELECT name FROM myRoom
  2  WHERE floorcolor||ceilingcolor||wallcolor like '%YELLOW%';

NAME
----------
Jim
Bob

SQL>
SQL> DROP TABLE myRoom;

Table dropped.

SQL>








10.4.VARCHAR2
10.4.1.Varchar type column
10.4.2.Compare VARCHAR2 type value for equlity
10.4.3.Use Like operator on VARCHAR2 column
10.4.4.Update VARCHAR column
10.4.5.INSTR(first_name,',', 1)
10.4.6.Add an index to a varchar2 type column
10.4.7.varchar2 type column with default value
10.4.8.Not equal operator for varchar
10.4.9.NOT BETWEEN with varchar type
10.4.10.Use IN for varchar type
10.4.11.varchar type not equals or null value
10.4.12.varchar type not equals or not null value
10.4.13.Concatenate strings
10.4.14.Use concatenated string in where clause
10.4.15.Search for String Across Columns
10.4.16.Save HTML value to table
10.4.17.Save xml data to varchar2 type column