CREATE TABLE empl_temp
(
employee_id NUMBER(6),
first_name VARCHAR2(20),
last_name VARCHAR2(25),
email VARCHAR2(25),
hire_date DATE DEFAULT SYSDATE,
job_id VARCHAR2(10),
clob_column CLOB
)
Table created.
INSERT INTO empl_temp
VALUES(111,'John','Doe','example.com','10-JAN-2015','1001','Experienced Employee')
1 row(s) inserted.
INSERT INTO empl_temp
VALUES(112,'John','Smith','example.com','12-JAN-2015','1002','Junior Employee')
1 row(s) inserted.
INSERT INTO empl_temp
VALUES(113,'Johnnie','Smith','example.com','12-JAN-2014','1002','Mid-Career Employee')
1 row(s) inserted.
INSERT INTO empl_temp
VALUES(115,'Jane','Doe','example.com','15-JAN-2015','1005','Executive Employee')
1 row(s) inserted.
SELECT * FROM empl_temp
EMPLOYEE_ID | FIRST_NAME | LAST_NAME | HIRE_DATE | JOB_ID | CLOB_COLUMN | |
---|---|---|---|---|---|---|
111 | John | Doe | example.com | 10-JAN-15 | 1001 | Experienced Employee |
112 | John | Smith | example.com | 12-JAN-15 | 1002 | Junior Employee |
113 | Johnnie | Smith | example.com | 12-JAN-14 | 1002 | Mid-Career Employee |
115 | Jane | Doe | example.com | 15-JAN-15 | 1005 | Executive Employee |
SELECT hire_date "Default",
TO_CHAR(hire_date,'DS') "Short",
TO_CHAR(hire_date,'DL') "Long"
FROM empl_temp
WHERE employee_id IN (111, 112, 115)
Default | Short | Long |
---|---|---|
10-JAN-15 | 1/10/2015 | Saturday, January 10, 2015 |
12-JAN-15 | 1/12/2015 | Monday, January 12, 2015 |
15-JAN-15 | 1/15/2015 | Thursday, January 15, 2015 |
SELECT To_char(clob_column) "CLOB_TO_CHAR"
FROM empl_temp
WHERE employee_id IN ( 111, 112, 115 )
CLOB_TO_CHAR |
---|
Experienced Employee |
Junior Employee |
Executive Employee |
SELECT To_char(employee_id) "NUM_TO_CHAR"
FROM empl_temp
WHERE employee_id IN ( 111, 112, 113, 115 )
NUM_TO_CHAR |
---|
111 |
112 |
113 |
115 |