I have source table emp in that columns are empno, ename, job, sal, comm, deptno, finally
I want to load target table as totalsal for each record (total sal=sal+comm), which transformation I have used.
I have source table emp in that columns are empno, ename, job, sal, comm, deptno, finally
I want to load target table as totalsal for each record (total sal=sal+comm), which transformation I have used.
one of the most simplest way is doing the same with an sql loader program.
Also you can use a External table and then do the change.
First take all data from source table into excel sheet.
Add one more column to the sheet name it total sal and do the calculation to join sal and comm column and place the sum in that column.Now save the Excel file in dat format.
Now write a ctl file maintaing the sequence and oonce u run the program. The data will be loaded.
There could be simple soln. trying to find that
create table totalsal as
select emp.*, (nvl(sal,0)+nvl(comm,0))totalsal from emp
This is the simplest solution.
Last edited by admin; 08-14-2007 at 06:32 AM.
You are correct, but by using this, your target table totalsal will be having all the columns of Emp and this totalsal.Originally Posted by Ash4u
As per the thread, he wants to have totalsal column only,
Therefore the Query will be,Originally Posted by hanumca07
create table totalsal as
select (nvl(sal,0)+nvl(comm,0))totalsal from emp
Sanghala
Last edited by sanghala; 08-16-2007 at 01:19 AM.
Sanghala
If you are satisfied with my reply. Please click “Thanks” button which increases the reputation and can serve you better.
Hi,
yes you are correct.Thanks for rectifying.