varchar type not equals or null value : VARCHAR2 « SQL Data Types « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> CREATE TABLE publishers(
  2    pub_id   CHAR(3)     NOT NULL,
  3    pub_name VARCHAR(20) NOT NULL,
  4    city     VARCHAR(15) NOT NULL,
  5    state    CHAR(2)     NULL    ,
  6    country  VARCHAR(15) NOT NULL);

Table created.

SQL>
SQL> INSERT INTO publishers VALUES('P01','A','New York','NY','USA');

1 row created.

SQL> INSERT INTO publishers VALUES('P02','C','San Francisco','CA','USA');

1 row created.

SQL> INSERT INTO publishers VALUES('P03','S','Hamburg',NULL,'Germany');

1 row created.

SQL> INSERT INTO publishers VALUES('P04','T','Berkeley','CA','USA');

1 row created.

SQL>
SQL> SELECT pub_id, city, state, country
  2    FROM publishers
  3    WHERE state <> 'CA'
  4       OR state IS NULL;

PUB CITY            ST COUNTRY
--- --------------- -- ---------------
P01 New York        NY USA
P03 Hamburg            Germany

SQL>
SQL>
SQL> drop table publishers;

Table dropped.

SQL>
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