Results 1 to 6 of 6

Thread: I want to load target table as totalsal for each record

  1. #1
    Junior Member
    Join Date
    Aug 2007
    Answers
    7

    I want to load target table as totalsal for each record

    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.


  2. #2
    Junior Member
    Join Date
    Jun 2007
    Answers
    8

    Re: I want to load target table as totalsal for each record

    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


  3. #3
    Junior Member
    Join Date
    Jun 2007
    Answers
    8

    Re: I want to load target table as totalsal for each record

    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.

  4. #4
    I am the DON
    Join Date
    Apr 2006
    Answers
    99

    Post Re: I want to load target table as totalsal for each record

    Quote Originally Posted by Ash4u
    create table totalsal as
    select emp.*, (nvl(sal,0)+nvl(comm,0))totalsal from emp

    This is the simplest solution.
    You are correct, but by using this, your target table totalsal will be having all the columns of Emp and this totalsal.

    As per the thread, he wants to have totalsal column only,
    Quote Originally Posted by hanumca07
    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.
    Therefore the Query will be,
    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.

  5. #5
    Junior Member
    Join Date
    Jun 2007
    Answers
    8

    Re: I want to load target table as totalsal for each record

    Hi,


    yes you are correct.Thanks for rectifying.


  6. #6
    I am the DON
    Join Date
    Apr 2006
    Answers
    99

    Thumbs up Re: I want to load target table as totalsal for each record

    Quote Originally Posted by Ash4u View Post
    Hi,


    yes you are correct.Thanks for rectifying.
    Good +ve thinking... Thanks

    Sanghala

    Sanghala

    If you are satisfied with my reply. Please click “Thanks” button which increases the reputation and can serve you better.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact