Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Truncate With Cascade

4155197Dec 17 2019 — edited Dec 18 2019

I have NO IDEA whats wrong...please help, guys! When I use Truncate with Cascade, it is asking for STORAGE key word, even when I provide it, it doesnt work. Most tutorials show Truncate table table_name3123 cascade to be working, BUT it is NOT working for me, I'm using SQL developer IDE Thnks in advance.

create table ports25

(port_id number,

port_name varchar2(20),

country varchar2(40),

capacity number,

constraint port_pk_9 primary key (port_id));

create table ships25

(ship_id number,

ship_name varchar2(20),

home_port_id number,

constraint ships_ports_fk_9 foreign key (home_port_id) references ports25 (port_id) on delete cascade);

insert into ports25 values (1, 'Baltimore', 'USA', 2);

insert into ships25 values (1, 'Codd Crystal',1);

insert into ships25 values (2, 'Codd Elegance',null);

select * from ports25;

select * from ships25;

truncate table ports25 reuse STORAGE CASCADE; --> Doesn't work!!!

This post has been answered by Jonathan Lewis on Dec 18 2019
Jump to Answer
Comments
Post Details
Added on Dec 17 2019
7 comments
1,361 views