varchar2 type column with default value : VARCHAR2 « SQL Data Types « Oracle PL/SQL Tutorial






SQL>
SQL> create table employee_locker (
  2  id                             number                         not null,
  3  logical_indicator              varchar2(1)   default 'N'      not null,
  4  physical_indicator             varchar2(1)   default 'N'      not null,
  5  code                           varchar2(30)                   not null,
  6  description                    varchar2(80)                   not null,
  7  active_date                    date          default SYSDATE  not null,
  8  inactive_date                  date );

Table created.

SQL>
SQL> insert into employee_locker ( id, logical_indicator, physical_indicator, code, description ) values ( 1, 'Y', 'N', 'B', 'Business Unit' );

1 row created.

SQL> insert into employee_locker ( id, logical_indicator, physical_indicator, code, description ) values ( 2, 'Y', 'N', 'C', 'Company' );

1 row created.

SQL> insert into employee_locker ( id, logical_indicator, physical_indicator, code, description ) values ( 3, 'Y', 'N', 'D', 'Department' );

1 row created.

SQL> insert into employee_locker ( id, logical_indicator, physical_indicator, code, description ) values ( 4, 'N', 'Y', 'L', 'Line' );

1 row created.

SQL> insert into employee_locker ( id, logical_indicator, physical_indicator, code, description ) values ( 5, 'N', 'Y', 'M', 'Machine' );

1 row created.

SQL> insert into employee_locker ( id, logical_indicator, physical_indicator, code, description ) values ( 6, 'N', 'Y', 'S', 'Site' );

1 row created.

SQL> insert into employee_locker ( id, logical_indicator, physical_indicator, code, description ) values ( 7, 'Y', 'Y', 'U', 'Unknown' );

1 row created.

SQL>
SQL>
SQL> drop   table employee_locker;

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