Map of the same different value of the column in different column based on conditio

Hi experts,

We source as Oracle tables and target also Oracel tables.

Source
--------
Column1 | Column2 | Column3

Goal
---------
trg1 | trg2

I need to
Insert the value of Column1 in trg1 where column2 = 'xxx '.
Insert the value of Column1 in trg2 where Column3 = "yyy".

After giving the conditions on mapping, the where conditions become clubed with and I get a different value to what is excluded. As the same way, I have the same scenario for most of the columns in my target table. Suggest me how do.

Thanks in advance.

Hello

to do everything in a single interface without performance issue you could do a join like this

Source.col2 = source2.src1 or Source.col2 = Source2.src2

This mapping and

Target.trg1

CASE WHEN Source.col2 = Source2.src1 THEN
Source.Col1
ANOTHER NULL
END

Target.TRG2

CASE WHEN Source.col2 = Source2.src2 THEN
Source.Col1
ANOTHER NULL
END

Tags: Business Intelligence

Similar Questions

  • How to divide the data in the column based identifier

    Hello

    I use the oracle database.
    I have data in this format in my column 1234 ~ 2345 ~ 3456 ~ 4567.

    I need a motion to split the data in the column based on the identifier ' ~', so that I can choose the value after the second occurrence of the identifier.


    Do I know who can do this.

    Published by: 962987 on October 3, 2012 12:11

    Hello

    Welcome to the forum!

    Whenever you have any questions, please post CREATE TABLE and INSERT statements for some examples of data and the results desired from these data. For example, in view of these data

    CREATE TABLE     table_x
    (       my_column     VARCHAR2 (40)
    );
    
    INSERT INTO table_x (my_column) VALUES ('1234~2345~3456~4567');
    INSERT INTO table_x (my_column) VALUES ('just~2 parts');
    

    I think you're asking for these results

    PART_3     MY_COLUMN
    ---------- ----------------------------------------
    3456       1234~2345~3456~4567
               just~2 parts
    

    I suppose that, if the string does not contain at least 2 ' ~ s, you want to return null. It's a good idea to explain what you want like that for special cases and include examples in your sample data and results.

    Not all versions of Oracle are exactly the same. In fact, they are all different. If you want the best solution that works with your version, then say what version it is.
    The following query will work in Oracle 10.1 and higher:

    SELECT  REGEXP_SUBSTR ( my_column
                    , '[^~]+'
                    , 1
                    , 3     -- 3rd occurrence (after 2nd delimiter)
                    )     AS part_3
    ,     my_column          -- if wanted
    FROM    table_x
    ;
    

    See the FAQ forum {message identifier: = 9360002}

    Published by: Frank Kulash, October 3, 2012 15:24
    Adding sample data and results.

  • Update the value of the column based on another value of the column to another table

    Hi all

    I have something very confused me and need your help.

    Having two tables A and B.

    Table A have 2 column (+ id + and desc1)

    Table B have column 2 also (+ transnum + and desc2)

    Now, I want to update the column desc2 of table B identical desc1 of table was where transnum of Table B same as the id of the table has.

    I use this SQL

    update of a2 set a2.desc2 = a1.desc1 of a2 on a2.transnum = a1.id inner join a1

    but this error occurs

    Error from line 5 in order:
    update of a2 set a2.desc2 = a1.desc1 of a2 on a2.transnum = a1.id inner join a1
    Error in the command line: 5 column: 35
    Error report:
    SQL error: ORA-00933: SQL not correctly completed command
    * 00933. 00000 - "command not properly ended SQL."
    * Question: *.

    * Action. *

    Hope someone can help me. TQ for help...
    SQL> create table a1 (id number(2),des varchar2(10));
    
    Table created.
    
    SQL> create table b1 (transnum number(2),des varchar2(10));
    
    Table created.
    
    SQL> insert into a1 values (1,'maran');
    
    1 row created.
    
    SQL> insert into b1 values (1,'ram');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> update b1 set des=(select des from a1 where b1.transnum=a1.id);
    
    1 row updated.
    
    SQL> select * from b1;
    
      TRANSNUM DES
    ---------- ----------
             1 maran
    
  • Conditionally display the values in the column based on another column

    Hello

    I'm sure this has been covered before, but I can't find anything appropriate based on the research I've done.

    I have 2 attributes in VO.

    I have a table that displays this VO.

    I still want to display header for both attributes, but I only want to show the value of attribute 1 in a row, if value of Attibute2 = 'I '.

    If Attibute2! = 'I', so I want just the column for Attribute1 to be empty space.

    I've not yet done anything with conditional expressions, and I wonder if someone could provide a link or a thread which is similar to this issue.

    Thank you

    Joel

    You can do according to the post above, but if you are not interested in changing the original Version and I want to just change the user interface page only, you can do as in the example below:


    lines = ' #{bindings. " Employee.rangeSize}.
    emptyText = "#{bindings." Employee.Viewable? "{'No data to display.': 'Access Denied.'}".
    fetchSize = "#{bindings." Employee.rangeSize}.
    rowBandingInterval = '0 '.
    selectedRowKeys = ' #{bindings. " Employee.collectionModel.selectedRow}.
    selectionListener = "#{bindings." Employee.collectionModel.makeCurrent}.
    rowSelection = "single" id = "t1" >

    headerText = "#{bindings." Employee.hints.Employeeid.label}.
    ID = "c2" >


    model = ' #{bindings. " Employee.hints.Employeeid.format}"/ >



    headerText = "#{bindings." Employee.hints.Employeename.label}.
    ID = 'c3' >



    headerText = "#{bindings." Employee.hints.Salary.label}.
    ID = "c1" >
    *
    ID = "ot2" >

    model = ' #{bindings. " Employee.hints.Salary.format}"/ >


    OutputText for the Attibute1, you can write the EL expression as:
    *<>
    * value = "#{rank." Attibute2 == "I"? "line. "{Attibute1:"}. "
    * id = "ot2" > *.

    I hope this helps.

    Thank you
    Nini

  • Update line in the column-based database

    Hello

    I am trying to find a way to update a row that has a SQL database based on two columns. If the command and the match number sensor order number and sales sensor that already exists in the database, I want to update the column of reading of the sensor. If not exists then I want that it creates a new line. How would I go to do this?

    Thank you

    Chris

    You can use the tools of DB Query.vi Execute. Here is an example of a MS Access 2010 database where a column value is updated in all rows satisfying the WHERE conditions.

    Ben64

  • How to set the width of the column based on the width of header?

    I have a column that will contain only 1 character. It's good, but I want that column width to match the column header.

    For example,.

    Currently, I get:

    Select * from table;

    I NAME
    - ---------
    1 ROBERT

    The problem is, I want the column heading set out (in this case, it's just the ID)

    ID NAME
    -- ---------
    1 ROBERT

    Better yet,.

    If I did:

    Select the ID "Identification NUMBER", "FIRST NAME" of table name;

    I want to see:

    ID NUMBER NAME
    --------------- -----------------
    1 ROBERT

    (The ID in the column width of centering would be good too, but it's "sauce")

    Any thoughts? I tried:

    FORMAT ID COLUMN A10 (which obviously didn't work!)

    Thank you

    KSL.

    Published by: leonhardtk on August 23, 2010 11:55

    Hello

    You can check [SQL Reference | http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions093.htm#SQLRF00663] for syntax.

    SELECT LPAD('A', 10) FROM DUAL;
    
  • Getting the value of a column based on the value of another column in a max group

    Please let me know if there is a simple way to do it.  I came up with a way, but it is terribly inefficient and it must work quickly.

    GROUP_ID NO_REGISTRE READ_VALUE QUARTERLY

    ---------- ----------- ---------- -----------------------------

    2 1 0.035 00:00:00.000000000 01/01/2015

    2 0.035

    3 1 1.11 14:50:32.943000000 14/07/2015

    3 2 222 01/01/0001 13:36:47.017436000

    3 223.11

    So what I need is for all no_registre is NULL, I need the value of QUARTERLY for the QUARTERLY to the MAX (READ_VALUE) for this GROUP_ID (not counting the rows where the no_registre is NULL).  So the result would look like this:


    GROUP_ID NO_REGISTRE READ_VALUE QUARTERLY

    ---------- ----------- ---------- -----------------------------

    2 1 0.035 00:00:00.000000000 01/01/2015

    2 0.035 00:00:00.000000000 01/01/2015

    3 1 1.11 14:50:32.943000000 14/07/2015

    3 2 222 01/01/0001 13:36:47.017436000

    3 223.11 13:36:47.017436000 01/01/01

    Someone at - it ideas?

    Or maybe:

    -production of the sample data:

    WITH t (GROUP_ID, no_registre, READ_VALUE, QUARTERLY)

    AS LONG AS)

    SELECT 2, 1, 0.035, TIMESTAMP ' 2015-1-1 00:00:00 ' FROM DUAL

    UNION ALL SELECT 2, NULL, 0.035, THE DOUBLE NULL

    UNION ALL SELECT 3, 1, 1.11, TIMESTAMP ' 2015-07-14 14:50:32 ' FROM DUAL

    UNION ALL SELECT 3, 2, 222, TIMESTAMP ' 0001-1-1-13:36:47 ' FROM DUAL

    UNION 3 SELECT ALL, NULL, 223.11, NULL FROM DUAL

    )

    --

    -actual query:

    --

    Select group_id

    no_registre

    read_value

    , last_value (quarterly) ignores NULL values over (partition by arrested by no_registre last read_value null, group_id) quarterly

    t;

  • Datapopulation the value of the column-based target

    Generals.

    It's my first post in this forum, so my apologies if my words are not correct.

    Use case:

    I have an ETL process (in ODI) fills my paintings. the table contains information of connection for users as its id, password encrypted etc. The process of ODI runs and fills in the data. The scenario is if the password in the target column is null then ODI must fill some default value. Is it already contains a value, then it should not be updated.

    How do I get there?

    thnks
    10.1.3.5 version

    1. integrate target this table source side.
    2 create a filter where is password IS NOT NULL column - cela make you ODI will not update the password of the target column
    3. on the use of column target password
    CASES WHERE IS NOT NULL
    THEN
    ON THE OTHER
    END

  • Master the detailed report, complete the columns based on selection LOV

    Hello

    When creating a master form / retail, I chose "Edit in detail in tables on the same page."  The form has a "report of the region" to select the list of employees.

    The EMPNO column is filled with "Popup LOV (named LOV)".  It works very well.

    My requirement is, after selecting an employee, I want other retail JOBS & SAL table fields to be populated with the information of the employee for selected EMP table and must be posted immediately.  Is this possible to do?  If not, what other solution available to achieve the same functionality?

    I tried this in Oracle.

    workspace: test_ws_anand

    user: anandgp

    password: cable123

    Watch ""list of skills "on the main menu. "

    Thank you

    -Anand

    Hi Anand,

    On the change of employee (employee selection) call Ajax via javascript and set the returned salary and job field.

    Here you have two values to return: wages and employment, you can generate json and parse the json in javascript and set the values for the specific field...

    Please see the sample code below

    Step 1: Create the Ajax application process

    Please check Procces Ajax, see line 7 How to assign a value to the variable sent by ajax call

    Declare
        L_JSON_STR varchar2(4000) := null;
        P_SAL number ;
        P_JOB varchar2(50);
        lc_emp_no VARCHAR2(20);
        Begin
        lc_emp_no := WWV_FLOW.G_X01;
        -- code to fetch the salary and commission into p_sal and p_job variable based on selected employee;
          SELECT sal
              , job
            INTO p_sal
              , p_job
            FROM emp
          WHERE empno = lc_emp_no; 
    
        -- build a JSON string to return
          L_JSON_STR := '{
                          "SAL": "'||P_SAL||'",
                          "JOB": "'||P_JOB||'"
                        }'; 
    
          SYS.HTP.P(L_JSON_STR);
        End;
    

    Step 2: Create the javascript function

    First, you must extract the rowid for which you want to define the work and wages, see line 6, 7, and 8

    
    
    Step 3 : from selection of employee call the function
    onchange="javascript:f_fetch_emp_dtls(this);"
    

    Hope this helps you,

    Kind regards

    Jitendra

  • How can I update the column based date?

    Hello..

    first I want to thank everyone for the help that you are given...

    I have a table that looks like this:

    the air course date

    ----------------------------------------------------

    X 0 NOV2013

    Y 900 OCT2013

    Z 800 OCT2013

    X 700 OCT2013

    Y 500 NOV2013

    X 100 NOV2011

    X 200 NOV2012

    ---------------------------------------

    I need a SQL expression for this

    ---------------------------------------

    If the price is 0

    then select the average price for the same air, and the same month but different year

    ------------------------------------

    for example in the table...

    When noncompliance X is 0 to DATE price NOV2013

    THEN select the average price for product X in NOV2012 NOV2011 AND

    THAT will be (100 200) = 100

    --------------------------------------------

    Naïve...

    Hello

    This?

    Note: I pushed since your unique records PROD, D

    SQL > select * from t1;

    D PRICE OF PROD

    ---- ---------- -----------

    X 0 01.11.2013

    Y 900 01.10.2013

    Z 800 01.10.2013

    X 700 01.10.2013

    Y 500 01.11.2013

    X 100 01.11.2011

    X 200 01.11.2012

    7 selected lines

    SQL >

    SQL > select q1.prod, q1.price, q1.d, avg (q2.price) avg_price

    2 from t1 t1

    3 join left t1 t2

    4 on q2.prod = q1.prod

    5 and trunc (q2.d, 'yyyy')! = trunc (q1.d, 'yyyy')

    6 and to_char (q2.d, 'mm') = to_char (q1.d, 'mm')

    Group 7 by q1.prod, q1.price, q1.d

    8.

    PROD AVG_PRICE D PRICE

    ---- ---------- ----------- ----------

    X 700 01.10.2013

    200 X 01.11.2012 50

    X 0 01.11.2013 150

    Z 800 01.10.2013

    Y 900 01.10.2013

    Y 500 01.11.2013

    X 100 01.11.2011 100

    7 selected lines

    SQL >

    SQL >

    SQL >

    SQL > fusion in t1

    2. using (select q1.prod, q1.price, q1.d, avg (q2.price) avg_price

    3 T1 t1

    4 join left t1 t2

    5 on q2.prod = q1.prod

    6 and trunc (q2.d, "yyyy")! = trunc (q1.d, "yyyy")

    7 and to_char (q2.d, 'mm') = to_char (q1.d, 'mm')

    q 8 group of q1.prod, q1.price, q1.d)

    9 on (q.prod = t1.prod and t1.d = q. at)

    10 when matched then

    11 update set t1.price = q.avg_price where t1.price = 0

    12.

    1 row merged

    SQL >

    SQL >

    SQL > select * from t1;

    D PRICE OF PROD

    ---- ---------- -----------

    X 150 01.11.2013

    Y 900 01.10.2013

    Z 800 01.10.2013

    X 700 01.10.2013

    Y 500 01.11.2013

    X 100 01.11.2011

    X 200 01.11.2012

    7 selected lines

    SQL >

    ----

    Ramin Hashimzade

  • How to map the csv (not columns) cells in the columns of table, import with sql loader

    Given «example.csv» csv file

    I want to load the data in:

    the C7 cell in column X

    cell D8 in column Y

    cell F7 in column Z

    Oracle table "exampletable" and so on. The csv file has not ordered rows and columns, so I can't just load the csv file into a new table itself. So what I'm asking is how to map to the columns in table cells load this file into Oracle (XE). Can someone point me to a tutorial?

    I know it's quite elementary, please let me know if I am sous-prescrit anything in the question.

    I ended up doing in Excel, through a very laborious process that will probably be repeated by others.

    What a pity that there is no functionality in Oracle for this kind of data import more flexible. Analysts of data often throw himself spreadsheets that look like this (or 485 of them) who must enter data one way or another.

  • How to change the color of line according to the value of the column

    Hi all

    I have an obligation to change the color of the column based on the value. As I have a table of results and the State are success and failure and progresses, if the State values is the success that should appear in green and if the status is failed, that should be red...

    Here is my table ADF Trinidad read only tables.

    Can someone help me with this.

    Thank you

    Hello

    Try this:

    styleClass="#{row.bindings.Status.inputValue=='IN PROGRESS' ? 'INPROGRESS' : row.bindings.Status.inputValue}"
    
  • Report view columns based on the selection of the month

    Hello

    I have an interactive report.
    In my report, I show the columns below. Let's say the show for months salary of the EMP for this month

    EmpID, ename, jan, Feb, mar, Apr, may, June, July, August, Sept, oct, nov, dec

    I have two selection lists (to filter the report) in my interface. P1_MONTH and P1_YEAR. These have static LOVs.
    Jan (Display) - 01 (Return)
    (Display) - 02 Feb (Return) and so on.

    I am facing problem while hiding under certain conditions the columns.
    For example, if the user selects the month "Mar." Then the report should display

    EmpID, ename, jan, Feb, mar

    Another example, if the month is "Jun" then

    EmpID, ename, jan, Feb, mar, Apr, may, June

    So he must hide under certain conditions the columns based on selection.
    I put the conditional 'view' in the column of the report for "expression of the ar-ticle/column value 1 = expression 2'.

    P1_MONTH (in the expression 1)
    + 06,07,08,09,10,11,12 (in the expression for the month of June selection 2) +.

    But doesn't the show/hide.
    Am I missing something? Please correct me if I'm wrong.

    I use APEX 4.1 & g 10 DB

    Thank you in advance,
    Daniel

    This

    value of item/column expression 1 = expression 2
    

    is equivalent to a PL/SQL expression, such as

    :P1_MONTH = '06,07,08,09,10,11,12'
    

    So maybe, select a PL/SQL expression condition and write something like that for the month of March - if I interpret correctly the your needs.

    TO_NUMBER(:P1_MONTH) <= 3
    

    Scott

  • The column report based on the build option

    Hello
    is it possible to display a column of report based on the selected build options?
    I can exclude the elements or even a full page by adding a compilation option, but I couldn't find any way to exclude a column of a report according to a compilation option (for example not displayed this column if the build option is xyz).
    Any ideas?
    Thank you
    Jochen

    Jochen:

    I have not tested, but creating a condition for the column based on the APEX_APPLICATION_BUILD_OPTIONS could provide a solution.

    CITY

  • Redirect to different pages based on the value of linked report table

    Hello

    I wanted to navigate to different pages of a report link based on a value from the table on which the report is based. I was able to link to a particular page without any problem.

    But I wanted to link to different pages depending on the value in the table. Please let me how can know I do this?

    Thank you

    Kaminey wrote:
    I use Apex 4.2 and my report is a classic.

    If I click on empID in a classic report, now it redirects to page 1. Now what I want to do, if I click empID, if his role as MANAGER he should redirect to page 2 and fill out the form on the page with the details of the employee. The role of the employee is ANALYST should redirect to page 3 and fill in the form on the page with its details

    This approach makes maximum use of the APEX has standard and minimizes the extra programming.

    1. If it is not already included as a displayed value, include the role column giving the value of MANAGER/ANALYST as a hidden column in the report.

    2. create the link in the column on the EmpID column, with the target of the link on the same page as the report and ask the role column value (for example #ROLE #).

    3. on the page of the report, create a On Load: front branch to page 2, with an request = Expression 1 condition with 1 Expression defined for the MANAGER.

    4. on the report page, create a On Load: front branch to page 3, with a Request = Expression 1 Expression 1 ANALYSTvalue condition.

Maybe you are looking for

  • Tecra R850-11U does not recognize memory full

    My Tecra R850-11U has 8 GB (2 x 4 GB) memory inside. I am under W7 Professional 64-bit, and the machine shows that 4 GB of memory. I've updated the bios, but the bios display also 4GB. I have 2 banks of original samsung memory still a change to a Ban

  • Is someone spying on me?

    Some strange things have developed to the end that suddenly somewhat concerned me that someone keeps track any activity on my macbook air. I see nothing wrong in the file of applications, but I have to admit that I am somewhat a sucker when it comes

  • Grub rescue

    I deleted the partition 12.04 linux on my hard drive. Windows partition 8.1 is still there, but after the removal of the linux partition, I rebooted the pc and just a black screen with error-> error: unknown file system.Grub rescue > I know that this

  • ENVY dv6: Windows reports that the "USB - IF xHCI USB Host Controller" device is not working properly.

    I received the instructions to fix it for a while, before the update to Windows 8.1 error below:

  • None of the icons are on the main screen of my office, how to make their comeback

    original title: a friend set a default language of English canada to American English, now none of my office, the icons are on the main screen, how can I get back them It seems that all my desktop icons are in a folder and when I click on an ex: bank