user2000465
user2000465

Reputation: 1

not able to use If exists statement in Oracle 9i

I have the below code :

INSERT INTO Table_Delete (name)
SELECT su_name
FROM   Student_Data
where class = '12'

MINUS
SELECT name
  FROM Students
  WHERE roll_num in (select roll_num from RollNumber
                       where class = '12');

COMMIT;
exit

I need to update this code to check if content of Table_Delete = Table_2 then empty Table_delete. I am not able to do this via If exists command.

Can anyone please help me on this ? I am using Oracle 9i.

Upvotes: 0

Views: 160

Answers (1)

Toping
Toping

Reputation: 755

select count(*) into ws_count from x where table_delete = table_2;
if(ws_count = 1) then

this way

Upvotes: 1

Related Questions