Single and Double Quotes and INSERT
You can include a single and double quote in a column value.
CREATE TABLE EMP (EMPNO NUMBER(4) NOT NULL,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
SAL NUMBER(7, 2),
DEPTNO NUMBER(2));
SQL> INSERT INTO emp VALUES (9, 'Kyle', 'O''s', NULL, NULL);
1 row created.
SQL>
SQL> select * from emp;
EMPNO ENAME JOB SAL DEPTNO
---------- ---------- --------- ---------- ----------
9 Kyle O's
SQL>
Using Double quotation marks
SQL> INSERT INTO emp VALUES (1, 'TOM','"Great"', NULL, 12);
1 row created.
SQL>
SQL> select * from emp;
EMPNO ENAME JOB SAL DEPTNO
---------- ---------- --------- ---------- ----------
9 Kyle O's
1 TOM "Great" 12
SQL>
Home »
Oracle »
Table »
Oracle »
Table »
Insert:
- Adding Rows Using the INSERT Statement
- Omitting the Column List
- Specifying a Null Value for a Column
- Single and Double Quotes and INSERT
- Copying Rows from One Table to Another with INSERT
Related: