hi experts,i need to move records from one table another.create table stagingtable( id int not null primary key, name varchar(10), city varchar(100), address varchar(10),)create table paxtable( id int not null primary key, name varchar(10), city varchar(10), address varchar(10),)create table logtable( id int not null identity primary key, rownum int, stepmessage varchar(100), errormessage varchar(100), transactiondate datetime)---- sample data for staging tableinsert into stagingtableselect 1,'name1','city1','address1' union allselect 2,'name2','abcdefghijklmnop','address2' union allselect 3,'name3','city3','address3' union all---- sample data for pax tableinsert into paxtableselect 1,'name','city','address'I need to prepare a stored procedure . the logic is followsI need to move records from stagingtable to paxtable.while moving records , If id already exists in paxtable then i need to update paxtable with stagingtable data Else i need to insert into paxtableinsertng rows/updated rows are should be delete from stagingtable.in logtable i need to store details for each row of staging tablelogtable should have data like belowid rownum stepmessage errormessage 1 1 row1:updated null 2 2 row2:insertionfailes error3 3 row3:insertionsucesses nullPlease help me..