Skip to toolbar

Forum

Create a program th...
 
Notifications
Clear all

Create a program that copies the departments located in 'CBE' to a table called 'DEPARTMENT_CBE. Do not use a cursor FOR loop. Display how many rows where copied else display the message 'No Records found'.  


Rahul U
Posts: 1
 Rahul U
Guest
(@Rahul U)
Joined: 2 months ago

Please check the attachment for additional information.

3 Replies
Sambit S
Posts: 41
 Sambit S
Guest
(@Sambit S)
Joined: 2 months ago

You can try this.

Begin

Insert into department_cbe
Select * from department
Where loc_id = 'CBE';
Commit;

If sql%found then
Dbms_output.put_line(sql%rowcount || ' Record(s) got copied');

Else
Dbms_output.put_line('No records found');
End if;

Exception
When others then
Rollback;

End;

Reply
1 Reply
Rahul Updhyay
(@rahul)
Joined: 2 months ago

Active Member
Posts: 17

@Sambit S sir it worked but output is different i want Record(s) got find one 

but is giving no record found

Reply
Rahul Updhyay
Posts: 17
(@rahul)
Active Member
Joined: 2 months ago

sir getting this error after compilation

Reply

Leave a reply

Author Name

Author Email

Title *

Maximum allowed file size is 10MB

 
Preview 0 Revisions Saved
Share: