Forum Stats

  • 3,759,060 Users
  • 2,251,495 Discussions
  • 7,870,477 Comments

Discussions

I wanted to know how we can move table data to another table using stored procedure

Albert Chao
Albert Chao Member Posts: 63 Green Ribbon
edited Sep 16, 2021 5:34PM in SQL & PL/SQL

Suppose there is one table Employees with the data

create table Employees (emp_id number, emp_name varchar2(50), salary number, department_id number, DESIGNATION varchar2(50), DEVELOPED_TESTED varchar2(50)) ;

insert into Employees values(1,'ALex',10000,10,'Developer','VLC');
insert into Employees values(2,'Duplex',20000,20,'Developer','VLC');
insert into Employees values(3,'Charles',30000,30,'Tester','Tested_VLC');
insert into Employees values(4,'Demon',40000,40,'Tester	','Tested_VLC');

select * from employees;

Now, using stored procedure I want to move Employees table data into another table say Department using the stored procedure. If you have such an example kindly share your thoughts on this. Create a procedure to move the data to another table will be more helpful if you can apply some conditions or filters. Just I want to learn how we can do this using stored procedure. Would appreciate it if you can share any example like this wherein we are applying some logic or filters then inserting them into another table?

Tagged:

Answers