Insert value to char type and varchar2 type
SQL> create table myTable(
2 codeValue char(2) not null,
3 address varchar2(30)
4 );
Table created.
SQL>
SQL> desc myTable;
Name Null? Type
------------------------- -------- ------------------
CODEVALUE NOT NULL CHAR(2)
ADDRESS VARCHAR2(30)
SQL>
SQL> insert into myTable values ('AZ','Arizona');
1 row created.
SQL> insert into myTable values ('AZ','Arizona');
1 row created.
SQL>
SQL>
SQL> select * from myTable;
CO ADDRESS
-- ------------------------------
AZ Arizona
AZ Arizona
2 rows selected.
SQL>
SQL> select address from myTable;
ADDRESS
------------------------------
Arizona
Arizona
2 rows selected.
SQL>
SQL>
SQL> drop table myTable;
Table dropped.
SQL>
Related examples in the same category