Truncate Command (DDL) in SQL Oracle With Implementation
For Explanation Watch Video::
Truncate:
-TO delete all rows from table at a time
- Deleting rows but not column
- By using this cmd we cant delete specific row from table
-It doesnt support where clause
EX:::
SQL> create table emp01(fname varchar2(10),sal Number(10));
Table created.
SQL> insert into empo1 values('miller',500000);
insert into empo1 values('miller',500000)
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> insert into emp01 values('miller',500000);
1 row created.
SQL> insert into emp01 values('Baburao',50000);
1 row created.
SQL> insert into emp01 values('Smith',500000);
1 row created.
SQL> select * from emp01;
FNAME SAL
---------- ----------
miller 500000
Baburao 50000
Smith 500000
SQL> truncate table emp01;
Table truncated.
After Truncate::
SQL> select * from emp01;
no rows selected
Note:: Deleting rows but not column
SQL> desc emp01;
Name Null? Type
----------------------------------------- -------- ----------------------------
FNAME VARCHAR2(10)
SAL NUMBER(10)
Comments
Post a Comment