Getting data from two sources

Hi all, i am trying to solve an specific scenario which i am having trouble with. here is my data
WITH data AS
SELECT 123 id, '10.30.2009' dt, 10 src, 'test1' name, 145 yd, 780 pdf, 'hd1' var FROM dual UNION ALL
SELECT 123 id, '10.31.2009' dt, 10 src, 'test2' name, 146 yd, 781 pdf, 'hd2' var FROM DUAL UNION ALL
SELECT 123 id, '11.10.2009' dt, 10 src, 'test3' name, 147 yd, 782 pdf, 'hd3' var FROM DUAL UNION ALL
SELECT 123 id, '11.11.2009' dt, 10 src, 'test4' name, 147 yd, 182 pdf, 'hd4' var FROM DUAL UNION ALL
SELECT 123 id, '11.12.2009' dt, 10 src, 'test5' name, 167 yd, 212 pdf, 'hd33' var FROM DUAL UNION ALL
SELECT 123 id, '11.13.2009' dt, 10 src, 'test6' name, 137 yd, 322 pdf, 'hd34' var FROM DUAL UNION ALL
SELECT 123 id, '9.27.2009' dt, 10 src, 'test7' name, 148 yd, 783 pdf, 'hd4' var FROM DUAL UNION ALL
SELECT 123 id, '10.12.2009' dt, 10 src, 'test8' name, 149 yd, 784 pdf, 'hd5' var FROM DUAL
data2
SELECT 123 id, '9.25.2009' dt, 11 src, 'test4' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '9.26.2009' dt, 11 src, 'test5' name, 135 yd FROM DUAL UNION ALL
SELECT 123 id, '9.27.2009' dt, 11 src, 'test7' name, 15 yd FROM DUAL UNION ALL
SELECT 123 id, '9.28.2009' dt, 11 src, 'test8' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '9.29.2009' dt, 11 src, 'test99' name, 175 yd FROM DUAL UNION ALL
SELECT 123 id, '9.30.2009' dt, 11 src, 'test44' name, 175 yd FROM DUAL UNION ALL
SELECT 123 id, '9.31.2009' dt, 11 src, 'test33' name, 148 yd FROM DUAL UNION ALL
SELECT 123 id, '10.1.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.2.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.3.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.4.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.5.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.6.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.7.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.8.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.9.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.10.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.11.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.12.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.13.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.14.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.15.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.16.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.17.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.18.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.19.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.20.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.21.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.22.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.23.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.24.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.25.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.26.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.27.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.28.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.29.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.30.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.31.2009' dt, 11 src, 'test' name, 146 yd FROM DUAL UNION ALL
SELECT 123 id, '11.01.2009' dt, 11 src, 'test' name, 147 yd FROM DUAL UNION ALL
SELECT 123 id, '11.2.2009' dt, 11 src, 'test' name, 148 yd FROM DUAL UNION ALL
SELECT 123 id, '11.3.2009' dt, 11 src, 'test' name, 149 yd FROM DUAL UNION ALL
SELECT 123 id, '11.4.2009' dt, 11 src, 'test' name, 141 yd FROM DUAL UNION ALL
SELECT 123 id, '11.5.2009' dt, 11 src, 'test' name, 148 yd FROM DUAL UNION ALL
SELECT 123 id, '11.6.2009' dt, 11 src, 'test' name, 149 yd FROM DUAL UNION ALL
SELECT 123 id, '11.7.2009' dt, 11 src, 'test' name, 141 yd FROM DUAL UNION ALL
SELECT 123 id, '11.8.2009' dt, 11 src, 'test' name, 141 yd FROM DUAL UNION ALL
SELECT 123 id, '11.9.2009' dt, 11 src, 'test' name, 141 yd FROM DUAL UNION ALL
SELECT 123 id, '11.10.2009' dt, 11 src, 'test' name, 141 yd FROM DUAL
as you can see there are some rows in data table that matches the id, dt in data2.
there is some rows in data2 that is not there in data table and vice versa. also both tables columns
are identical except that data has more columns that data2 doesnt have.     i want to write a query.
i would like to join data and data2 table.
if a row in data table matches a row in data2 then i would take the row in data table
and display it along with the rest of the columns. if a row is not found in data but it is found
in data2 for a particular id (in this case 123) then i want to display the row from data2 and the rest of the columns value from data2.
please note that in the data above i gave you one specific id 123. my tables will have the same situation as above
for different id. the output of the above query should be as follow.
ID DT SRC NAME YD PDF VAR
123     9.25.2009 11 testt 145
123     9.26.2009 11 test5 135
123     9.27.2009 10 test7 148 783 hd4
123     9.28.2009 11 test8 145
123     9.29.2009 11 test99 175
123     9.30.2009 11 test44 175
123     9.31.2009 11 test33 148
123     10.1.2009 11 test 145
123     10.2.2009 11 test 145
123     10.3.2009 11 test 145
123     10.4.2009 11 test 145
123     10.5.2009 11 test 145
123     10.6.2009 11 test 145
123     10.7.2009 11 test 145
123     10.8.2009 11 test 145
123     10.9.2009 11 test 145
123     10.10.2009 11 test 145
123     10.11.2009 11 test 145
123     10.12.2009 10 test8 149 784 hd5
123     10.13.2009 11 test 145
123     10.14.2009 11 test 145
123     10.15.2009 11 test 145
123     10.16.2009 11 test 145
123     10.17.2009 11 test 145
123     10.18.2009 11 test 145
123     10.19.2009 11 test 145
123     10.20.2009 11 test 145
123     10.21.2009 11 test 145
123     10.22.2009 11 test 145
123     10.23.2009 11 test 145
123     10.24.2009 11 test 145
123     10.25.2009 11 test 145
123     10.26.2009 11 test 145
123     10.27.2009 11 test 145
123     10.28.2009 11 test 145
123     10.29.2009 11 test 145
123     10.30.2009 10 test1 145 780 hd1
123     10.31.2009 10 test2 146 781 hd2
123     11.01.2009 11 test 147
123     11.2.2009 11 test 148
123     11.3.2009 11 test 149
123     11.4.2009 11 test 141
123     11.5.2009 11 test 148
123     11.6.2009 11 test 149
123     11.7.2009 11 test 141
123     11.8.2009 11 test 141
123     11.9.2009 11 test 141
123     11.10.2009 10 test3 747 782 hd3
123     11.11.2009 10 test4 147 182 hd4
123     11.12.2009 10 test5 167 212 hd33
123     11.13.2009 10 test6 137 322 hd34
123     11.14.2009 11 test 141
if you notice, i am displaying the data from data table when there is a match in data and data2 tables for a particular id, dt combination.
if there is data in data2 that is not in data then i pull those data from data2 and display. the same thing goes for data table. if there is data in data table
but it is not there in data2 then i display data from data table. when rows matches then i take the one from data table
i would like to write a query that give the above output. if anybody can help, i will appreciate.
thanks

Hi,
I'm sorry, misread it and didn't look wll at the outcome. This is better:
WITH data AS
SELECT 123 id, '10.30.2009' dt, 10 src, 'test1' name, 145 yd, 780 pdf, 'hd1' var FROM dual UNION ALL
SELECT 123 id, '10.31.2009' dt, 10 src, 'test2' name, 146 yd, 781 pdf, 'hd2' var FROM DUAL UNION ALL
SELECT 123 id, '11.10.2009' dt, 10 src, 'test3' name, 147 yd, 782 pdf, 'hd3' var FROM DUAL UNION ALL
SELECT 123 id, '11.11.2009' dt, 10 src, 'test4' name, 147 yd, 182 pdf, 'hd4' var FROM DUAL UNION ALL
SELECT 123 id, '11.12.2009' dt, 10 src, 'test5' name, 167 yd, 212 pdf, 'hd33' var FROM DUAL UNION ALL
SELECT 123 id, '11.13.2009' dt, 10 src, 'test6' name, 137 yd, 322 pdf, 'hd34' var FROM DUAL UNION ALL
SELECT 123 id, '9.27.2009' dt, 10 src, 'test7' name, 148 yd, 783 pdf, 'hd4' var FROM DUAL UNION ALL
SELECT 123 id, '10.12.2009' dt, 10 src, 'test8' name, 149 yd, 784 pdf, 'hd5' var FROM DUAL
data2 as
SELECT 123 id, '9.25.2009' dt, 11 src, 'test4' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '9.26.2009' dt, 11 src, 'test5' name, 135 yd FROM DUAL UNION ALL
SELECT 123 id, '9.27.2009' dt, 11 src, 'test7' name, 15 yd FROM DUAL UNION ALL
SELECT 123 id, '9.28.2009' dt, 11 src, 'test8' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '9.29.2009' dt, 11 src, 'test99' name, 175 yd FROM DUAL UNION ALL
SELECT 123 id, '9.30.2009' dt, 11 src, 'test44' name, 175 yd FROM DUAL UNION ALL
SELECT 123 id, '9.31.2009' dt, 11 src, 'test33' name, 148 yd FROM DUAL UNION ALL
SELECT 123 id, '10.1.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.2.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.3.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.4.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.5.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.6.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.7.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.8.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.9.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.10.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.11.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.12.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.13.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.14.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.15.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.16.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.17.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.18.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.19.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.20.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.21.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.22.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.23.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.24.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.25.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.26.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.27.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.28.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.29.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.30.2009' dt, 11 src, 'test' name, 145 yd FROM DUAL UNION ALL
SELECT 123 id, '10.31.2009' dt, 11 src, 'test' name, 146 yd FROM DUAL UNION ALL
SELECT 123 id, '11.01.2009' dt, 11 src, 'test' name, 147 yd FROM DUAL UNION ALL
SELECT 123 id, '11.2.2009' dt, 11 src, 'test' name, 148 yd FROM DUAL UNION ALL
SELECT 123 id, '11.3.2009' dt, 11 src, 'test' name, 149 yd FROM DUAL UNION ALL
SELECT 123 id, '11.4.2009' dt, 11 src, 'test' name, 141 yd FROM DUAL UNION ALL
SELECT 123 id, '11.5.2009' dt, 11 src, 'test' name, 148 yd FROM DUAL UNION ALL
SELECT 123 id, '11.6.2009' dt, 11 src, 'test' name, 149 yd FROM DUAL UNION ALL
SELECT 123 id, '11.7.2009' dt, 11 src, 'test' name, 141 yd FROM DUAL UNION ALL
SELECT 123 id, '11.8.2009' dt, 11 src, 'test' name, 141 yd FROM DUAL UNION ALL
SELECT 123 id, '11.9.2009' dt, 11 src, 'test' name, 141 yd FROM DUAL UNION ALL
SELECT 123 id, '11.10.2009' dt, 11 src, 'test' name, 141 yd FROM DUAL
select data2.id,data2.dt,nvl(data.src,data2.src) src, nvl(data.name,data2.name) name,nvl(data.yd,data2.yd) yd,data.pdf,data.var
from data2,data
where data2.id = data.id(+)
and data2.dt = data.dt(+)Herald ten Dam
Superconsult.nl

Similar Messages

  • Get data from two databases?

    Hello all,
    Do anyone know if it's posible to get data from two databases while I'm running SBO in one of them? I need this because our client wants to be able to print reports with all the information stored in both companies. I searched this forum trying to find if this is possible but I did't find any information about this.
    Can someone help me?
    Thanks and regards,
    Mariana Mazzero

    Hi Mariana,
    What you can do is use two company objects to retrieve the data. As far as I know you're not restricted to one company connection.
    You can also just use a standard read only connection (like ADO/ODBC) to retrieve the data for the reports.
    Hope it helps,
    Adele

  • SaveToFile example modificati​on to get data from two channels simultaneo​usly.

    We are trying to modify the “SaveToFile” example for C++. This particular example comes with NI-scope 2.9.1 and some other versions. This example collects data from one channel and saves the output as a text file. Also, we are using NI PCI-5112 DAQ.
    However, it can be modified to get data from channel 0 and channel 1 at the same time. There is a help file called “Fetching Multiple-Record Acquisitions”, which is under the NI-High speed digitizer help topics. This confirms that you can modify the code to get data from two channels and the output will be a text file where every other value is from one channel. This help file also gives some code. However, it is not very much helpful to us, please keep in mind that we have only taken a basic course in C++.
    Our project is to analyze the data, however, we need to acquire the data before we can analyze. We have spent so much time trying to get the data.  What we need to do is get data from both channels simultaneously and output the data as a text file.
    Can anyone help us to modify the code so it can get data from both channels simultaneously? Or can anyone help as where we can get more information? Or does anyone know of any sample examples that will take data from two channels simultaneously and output the data as a text file or any other type of document.
    Any help will be really appreciated, as we have spent so much time trying to acquire the data.
    Thanks.

    Hi Finomad,
    Please see this post for an answer to your question.
    Regards,
    Natasa

  • To Load Master Data From Two Source System

    Hi All,
    I have a small question :
    - Can we load master data from two different source system say from flat file and R3 or any two different or similar source  system?
       If answer is "Yes", then how?? If possible step by step.
    Appreciate your valuable points.
    Thanks,
    Niraj Sharma

    Hi,
    Still i have problem.R3 Transformation and DTP is getting activated but when i am executing DTP for flat file,
    I am getting below ERROR.
    Object DTP DTP_d55.......could not found in version A.
    I have  checked the Master data locally for source sys in compounding Tab of the key field.
    Please help..
    Thanks,
    Niraj

  • How to get data from external source

    Hi experts,
       I want to get data from a different source e.g. from oracle. How can i get the data in BW??
    Sam

    Hi Samir
    there are different interfaces are available according to the source system.
    For Oracle source system you can use DB connect interface.
    you can extract data from several data sources to BI
    File Interface:: Using this interface, you can access files in ASCII format or CSV format
    DB Connect :: You use DB Connect to open other database connections in addition to the default connection and use these connections to transfer data from tables or views into a BI system.
    UD Connect :: UD Connect (Universal Data Connect) uses the Application Server J2EE connectivity to enable the reporting and analysis of both SAP and non-SAP data. Using UD Connect, you can access all relational and multidimensional data sources. UD Connect transfers the data as flat data.
    BI Service API ::
    Web Service for Staging ::You use the Web service to write the data from the source into the PSA. The transfer of data is controlled externally, without placing demand on BI.
    You can use this interface in conjunction with real-time data acquisition.
    Please assign points if this info helps.
    Regards
    Vivek..

  • Acquiring streaming data from two sources

    I�m trying to acquire data from two devices at the same time. I have written two sub VI�s where each one takes the data from one piece of equipment. The equipment is such that they are both constantly outputting data. I have been successful in running both of the sub VI�s separately at the same time. The trouble occurs when I try to put the sub VI�s together in a larger VI. When the two sub VI�s part of a larger VI, both cannot run at the same time. One of the sub VI�s tries to read from the serial port and is unable to get anything in response. Is there something I am missing as to why they can not be running at the same time?

    Hello,
    It is possible that you are seeing the consequences of LabVIEW compiling code written in parallel. More specifically, if you have code in parallel (not connected by dataflow, but in the same block diagram) LabVIEW will split execution time between those parts of your code. Previously you were likely manually starting two separate programs, which inherently adds a delay between the start of the programs, allowing the first program to get sufficiently far in its execution; we could be seeing the consequence of this. It would help if you could be more specific about the details of your setup and code (such as 1. which instruments are connected to which ports? 2. are you writing a command to your instruments and then receiving data as a response? 3. do you rec
    eive any errors? 4. if you do receive errors, which errors do you see and where in your code do you first see them?).
    Repost with some more information (perhaps a screen shot or your code) and we can get a more definitive answer!
    Thank you,
    Regards,
    JLS
    Applications Engineer
    National Instruments
    Best,
    JLS
    Sixclear

  • Master Data from two source systems

    Hi Gurus,
    I need to load master data from two different source systems. What is the best way I could do that ?
    I know one approach is add system id 0logsys as prefix in compound tab and load it. But problem is master data table will have two different records and in the report it will display 2 records, can not summarized it in the report. But I need one record in the report. What is the best approach ?
    Thanks
    Liza

    Hi,
    Create two DataSources. one for each of the source system.
    Create two separate flows to the master from these two DataSources.
    Hope this helps!

  • Unexpected results getting data from two fact tables through conformed dim

    Hi all,
    We are getting an unexpected behaviour in our OBIEE 10.1.3.3.3. We have this scenario:
    We have {color:#0000ff}2 fact tables{color}{color:#000000} called F1 and F2. F1 has one measure, f1m1 and F2 has another one, f2m1.
    We have {color:#0000ff}4 conformed dimensions{color}, called D1, D2, D3, Date.
    When we are requesting for individual fact tables, we are getting:
    date d1 d2 d3 f1m1
    dt1 - x - y - z - m1
    dt1 - x - y - z' - m2
    date d1 d2 d3 f2m1
    dt1 - x - y - z - m3
    dt1 - x - y - z'' - m4
    But, trying to obtain a compare scenario, we are getting
    date d1 d2 d3 f1m1 f2m1
    dt1 x y z m1 m4
    Instead of
    date d1 d2 d3 f1m1 f2m1
    dt1 x y z m1 m3
    Looking at query log, we have catched the reason. That's why BI Server is using to solve this request using ROW_COUNT() to join SAWITH0 and SAWITH1 in SAWITH2 result set. So, the order may not be the same in the results sets in every fact table. More or less, generated query is like:
    WITH
    SAWITH0 AS
    (select ....
    from F1),
    SAWITH1 AS
    (select ...
    from F2),
    SAWITH2 AS
    select from (select ...
    ROW_NUMBER() OVER PARTITION (....) c10
    from SAWITH0.d1 full outer join SAWITH1.d1 ....) D1
    {color:#ff0000}where (D1.c10 = 1){color}
    select SAWITH2. ....
    from SAWITH2
    order by c1..c10
    The problems seems to be that BI server is ordering the result sets SAWITH0 and SAWITH1 and getting row number to join this results sets, but this is not getting the correct result.
    Any ideas?
    TIA
    Javier
    {color}
    Edited by: jirazazábal on Mar 13, 2009 2:46 PM

    I have done a logical fact table with two fact table source on it.
    The Sql performed against the database was this one.
    -------------------- Sending query to database named PRODS_AIX (id: <<153418>>):
    WITH
    SAWITH0 AS (select sum(T21296.CONSUMERS_SALES_EURO) as c1,
         T21309.DIVISION_CODE as c2
    from
         DIVISION T21309,
         C_CONSUMERS_SALES T21296
    where  ( T21296.DIVISION = T21309.DIMENSION_KEY )
    group by T21309.DIVISION_CODE),
    SAWITH1 AS (select sum(T21356.ORDER_VALUE) as c1,
         T21309.DIVISION_CODE as c2
    from
         DIVISION T21309,
         DWH_SALES_ORDER_OVERVIEW T21356
    where  ( T21309.DIMENSION_KEY = T21356.DIVISION_KEY )
    group by T21309.DIVISION_CODE)
    select distinct case  when SAWITH0.c2 is not null then SAWITH0.c2 when SAWITH1.c2 is not null then SAWITH1.c2 end  as c1,
         SAWITH0.c1 as c2,
         SAWITH1.c1 as c3
    from
         SAWITH0 full outer join SAWITH1 On nvl(SAWITH0.c2 , 'q') = nvl(SAWITH1.c2 , 'q') and nvl(SAWITH0.c2 , 'z') = nvl(SAWITH1.c2 , 'z')
    order by c1As you can see one select (SAWITH0) for the first fact table C_CONSUMERS_SALES and one select for the second fact table DWH_SALES_ORDER_OVERVIEW (SAWITH1 ) and the two statement are joined with a full outer join.
    I ask me why you have the three select (SAWITH0,SAWITH1 and SAWITH2). Can you please paste the complete SQL performed ?
    Can you tell us also which SQL is performed if you select only the columns from one fact table and not for the other ?
    Regards
    Nico
    http://gerardnico.com

  • Getting data from two servers?

    Experts-
    We have two servers for storing tables . 1. Historical server 1.Current Prod server
    We have same tables in both server databases.
    All the info prior to a month of current date is stored in Historical server database tables
    and the rest in current prod server dtabase tables.
    I have to build reports such that, when user enters a date, OBIEE has to check if the date is in a month period(30 days) of todays date or earlier to 30 days, based on this, it has to get the data from historical server database tables / current prod server database.
    How can I implement this?
    Do I need to create two connction pools(folders in rpd) and develop same Model twice?(One for historical tables and one for prod tables?)
    or Can I use fragmentation technique? if so, Can you give me an Idea hwow to implement Fragmentation for this requirement?
    Thanks for your help in advance

    You should use fragmentation for this requirement. It's not that hard once you've understood the basic principle. Read Nico's article here for the detail:
    http://gerardnico.com/wiki/dat/obiee/fragmentation_content
    The only non-standard bit for you will be to set the fragmentation criteria on your logical table sources. This is the part that tells BI server which source to hit.
    Post back here if you get stuck.
    Paul

  • ALV OOps report- getting data from two tables and adding issue

    Hi,
    This is sales employee performance report.
    I need to select all the fields from two tables based on user input ie VKorg, sales employee .
    There is one field callled " Net sales"in both the tables.
    Based on sales employee number, i need to add that net sales which i get from two tables.
    I need to generate single report.
    Can you give some inputs reg. the select query.
    My idea is select all the data from both tables using join statement.
    Thanks

    Hi,
    I have written like this:
    select * from S002 as a join S006 as b
        into table ME->SS002_RAW[]
        where vkorg in me->select_parameters->SO_VKORG[] = vkorg in me->select_parameters->SO_VKORG[]
              and ZZSLSEMP01 in me->select_parameters->SO_so_empl[] = ZZSLSEMP02 in me->select_parameters->SO_so_empl[].
    when i do like that,
    I am getting error
    Incorrect structure of FROM clause . . . .     
    If you give some idea on this
    Edited by: Raja on Apr 22, 2009 11:19 AM

  • Line Chart - getting data from two table to behave as 1 data series

    I'm using the 'Personal Budget' template, and have two tables titled 'Annual Budget by Month: 2009' and 'Annual Budget by Month: 2010'. These tables show, as their last row, my total savings. I want to set up a line chart to display the (downward) trajectory of my savings in one continuous line.
    However, if I create a line chart, the two data sets from the two tables are displayed as two lines, one below the other. If I convert it to a column chart, and then switch to columns instead of rows as the Plotting Orientation (data series button in the upper left of the table), the columns do display correctly. Can anyone tell me how I can get the line version to work?

    spiff,
    I think the solution to your problem is to create a summary table that gathers the data from all your month tables, then plot the summary. Remember to put the category names into a Header row or column so they will automatically show up on the chart axes.
    Jerry

  • Get data from two partitions

    I want to do a query that returns data only from last two partitions
    I have this select that returns data from one partition only.
    select *
    from tsieven PARTITION(P200707_2Q)
    I would like to have something like this for example...
    select *
    from tsieven PARTITION(P200707_2Q and P200707_1Q)

    Oracle version is 9i
    Partition method (MAX VALUE): TO_DATE(' 2006-04-16 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
    Usually the partition is divided by 15 days. starts in the begin of the month and ends in 15th of the same month.
    Partition column: DATA_CRIACAO
    I'm trying to to this query:
    select tsieven.loptica, tsieven.data_evento Data_Distribuicao
    from tsieven (PARTITION MAX), tgirnos n, tsiobje o
    where tsieven.no_evento = n.COD_NO
    and tsieven.loptica = o.loptica
    and to_char(tsieven.data_evento,'dd-mm-yyyy') = to_char(p_data,'dd-mm-yyyy')
    and o.cod_classe = p_classe
    and n.COD_TIPO_NO='2'
    and tsieven.COD_T_EVEN = 'EMZ'
    and n.cod_no = p_cdp
    order by tsieven.loptica
    For example I need to get data for sysdate from 27th of july it's not in this last partition, because it started a new one in 1st of august.
    Hope I'm being clear now.
    Thanks for your help.

  • GETTING DATA FROM TWO TABLES.

    Hi,
    I am having i_matgrp table with fields matkl , l_sum , l_t_sum.
    I need to get material group description(wgbez,wgbez60) from t023t table for each matkl in i_matgrp
    and put all 3 fields and descriptions(2 fields) in to a single table i_display for display.
    please suggest select query for this...
    Thanks in advance.

    I am having i_matgrp table with fields matkl , l_sum , l_t_sum.
    I need to get material group description(wgbez,wgbez60) from t023t table for each matkl in i_matgrp
    and put all 3 fields and descriptions(2 fields) in to a single table i_display for display.
    please suggest select query for this...
    hi.
    sorry do like in this way.just copy paste it and check t
    but also paste ur code for the internal table of i_matgrp which u have made
    data: begin of itab,
    matkl like t023t-matkl,
    wgbez like t023t-wgbez,
    wgbez60 like t023t-wgbez,
    end of itab.
    data:wa_itab like itab.
    data:wa_i_matgrp like i_matgrp.
    data: begin of i_display,
    matkl like t023t-matkl,
    l_sum type i,
    l_t_sum type i, "these two fields can be according to ur need,
    wgbez like t023-wgbez,
    wgbez60 like t023t-wgbez60,
    end of i_display.
    data: wa_i_display like i_display.
    select matkl wgbez wgbez60 into corresponding fields of itab
    from t023t FOR ALL ENTRIES IN i_matgrp
    where matkl = i_matgrp-matkl.
    loop at i_matgrp into wa_i_matgrp.
      MOVE-CORRESPONDING wa_i_matgrp to wa_i_display.
      read table itab into wa_itab WITH KEY matkl = wa_i_matgrp-matkl.
       MOVE-CORRESPONDING wa_itab to wa_i_display.
      append wa_i_display to i_display.
    endloop.
    Edited by: tahir naqqash on Feb 17, 2009 1:07 PM

  • Get data from two joined tables there are not in both

    At first, that tabes are in shortcut. To get this tables I need to use lot of joins (about 3-4).
    TABLE "OBIEKTY"
    ZAKLAD          OBIEKT            
    1               100                   
    1               200                   
    1               300                   
    TABLE "OPIS"
    ZAKLAD          OBIEKT          NAZWA           TYP             
    1               100             obiekt 1        A                   
    1               200             obiekt 2        B                   
    1               400             obiekt 3        C                    I have to get:
    NEEDED RESULT
    ZAKLAD          OBIEKT          NAZWA           TYP             
    1               400             obiekt 3        C   I have two tables with many rows, so executing "not in (select...)" for each one row is not to good I think :)
    select obiekt, zaklad, nazwa, typ
        from opis where (zaklad, obiekt) not in (select zaklad, obiekt from obiekty)

    For your input and output use below code
    select * from OPIS WHERE OBIEKT             IN 
    select  OBIEKT             from OPIS
    minus
    select OBIEKT             from OBIEKTY)

  • Getting data from some source and insert into corresponding source

    hi all,
    i am using db10g.
    i have like like
    MMA : add1:add2:add3'the above said is the format and actual data will be something like
    MMA : bank street : no:32 : tel: +9127546663
    add1 = bank street
    add2 = no:32
    add3 = tel: +9127546663 my requirement to store add1,add2 and add3 into the table.
    So to take the data i am using substring and instring function to get the data with respect to : my problem is for example in add2 place no:32 is there my task is to fetch the no:32 from that line and store into the table as no:32 only in that case i cannot fetch the value in terms of :.
    sincr : is the delimiter(seperator for data element)
    how can i solve this issue?
    Thanks..
    Edited by: user13329002 on Jan 1, 2011 11:37 PM

    Your first addr1 is terminated by (:).
    your second addr2 is started with (no:), and also terminated by (:)
    and third addr3 is started with (tel:).
    only the first and third (:) will be used as delimiter, so how about this?
    WITH T AS (SELECT 'bank street:no:32:tel:+9127546663' AS STR FROM DUAL)
    SELECT SUBSTR(STR, 1, INSTR(STR, ':', 1, 1)-1) AS ADD1,
    SUBSTR(STR, INSTR(STR, ':', 1, 1)+1, INSTR(STR, ':', 1, 3)-INSTR(STR, ':', 1, 1)-1) AS ADD2,
    substr(str, instr(str, ':', -1, 2)+1) as add3 from t;
    bank street       no:32     tel:+9127546663Or can`t you just ask the people who gave the requirement to change the delimiter used in the format to something else like pipe (|)?

Maybe you are looking for

  • Flexible planning

    Hi We are using S076 SOP table for SD report (Sales Forecast Report ).  This has only material number as key, where as we want to know if flexible planning will give material/shipto as key for forecast. Thanks In advance .

  • Faxing issues HP Laserjet PRO 200 color MFP M276nw

    When the product is ON receiving and sending fax is going ok, but when the product is on auto power down it don't awakes as it should when a fax is incomming. I have an ISDN line with a separate number for fax and a second number for voice calls. The

  • SAP Upgrade  from SAP R/3 4.6 C to ECC6.0,  Delete DMC componenet

    Dear All, We are upgrading SAP from R/3 4.6C  to ECC6.0 . Our client has installed DMC in 4.6C as a "Main transport" request .   DMC becomes an Add-on tool in ECC6.0 . SAP pepare phase recognize DMC is already installed in 4.6C  and required  upgrade

  • Posting down payment using the payment program

    Dear all, I post the down payment with the payment program. After run payment program. I choose Edit -> Payments -> Payment List to show the result of the payment run But I receive message F0073 Program RFRALI20: No records selected Disagonosis: The

  • Deployment from version 701.4 to lower version (700.14) portal?

    Hi all, We are in a situation where our VC development portal has been upgraded to 7.01.4 (EHP1 SP4 of NW 7.0, not CE). But now we have a model we want to deploy to a portal at a lower version - SP 14 of 7.00.  When we try to deploy it we get a blank