Information from two views in one report

I posted a thread earlier but I think I was little amibiguous about my problem and posted too much info. on the background of the problem maybe I can clarify.
I have a report on a view TRK_CALLS_VIEW. This is dblinked to a table. Columns include
User_
Assigned_to
Problem
Solution
Status
Here is my region source code:
SELECT webb.TRK_CALLS_VIEW.ID, webb.TRK_CALLS_VIEW.USER_, webb.TRK_CALLS_VIEW.ASSIGNED_TO, webb.TRK_CALLS_VIEW.PROBLEM, webb.TRK_CALLS_VIEW.SOLUTION, webb.TRK_CALLS_VIEW.STATUS
FROM webb.TRK_CALLS_VIEW
WHERE
( STATUS = 'Open' and :P2_REPORT_SEARCH is null )
or
( regexp_like( USER_ || '#' || ASSIGNED_TO || '#' || PROBLEM || '#' ||
SOLUTION || '#' || STATUS, :P2_REPORT_SEARCH, 'i' ) )
I want to include columns from another view in the report. TRK_USER_VIEW.
Columns include:
id
lname
fname
User_ from TRK_CALLS_VIEW contains the same number as id in TRK_USER_VIEW.
How would I add this to my existing code and have the names corespond to the correct id
Thanks

so in the above code you can see that both the webb.TRK_CALLS_VIEW and webb.TRK_USER_VIEW have some column that are named the same. eg/ "USER_","id". That is fine as SQL has provided a means to uniquely identify the columns. When you join these two views together and try to select or reference either the USER_ or id column without specifying which view you want to get the information from then that creates ambiguity and the compiler does not know if you want the USER_ form view 1 or view 2 and thus there is an error.
To solve this issue we need to use . (dot) notation to specify the object (in this case view) which holds the column we want. We will also alias columns which share the same name. Here is how we would modify the above SQL statement:
SELECT
------ View 1 ------
       tcv.ID          "TCV_ID", -- ID has been aliased to a unique name.
       tcv.USER_,
       tcv.ASSIGNED_TO,
       tcv.PROBLEM,
       tcv.SOLUTION,
       tcv.STATUS,
------ View 2 -------
       tuv.id          "TUV_ID", -- ID has been aliased to a unique name.
       tuv.lname,
       tuv.fname
-- also i used the alias tcv and tuv so that i could refer to the views by just using the alias rather than the lengthy view name.
FROM webb.TRK_CALLS_VIEW tcv,
     webb.TRK_USER_VIEW tuv
-- This is where we JOIN the views on a key value. In this case USER_.
-- Always make sure your joins are the first portion of your where clause.
WHERE tcv.USER_ = tuv.USER_
-- I have explicetly referenced the view i want the column to come from by putting
-- "tcv." infront of each column name. This tells the compiler to use TRK_CALLS_VIEW
  AND ( tcv.STATUS = 'Open' and :P2_REPORT_SEARCH is null )
   OR ( regexp_like( tcv.USER_ || '#' || tcv.ASSIGNED_TO || '#' || tcv.PROBLEM || '#' ||
      tcv.SOLUTION || '#' || tcv.STATUS, :P2_REPORT_SEARCH, 'i' ) )
{code}
Edited by: Tyson Jouglet on Oct 8, 2008 9:10 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to Use views of one report to other reports

    I have so many reports with same views like static text, header & footer .
    My question is: I have created these views on some reports which are same to all reports as i said. Now i want to use these views from the existed reports without creating once again which takes long time to ensure that size and color everything should be same for all reports for those views.
    Can any body give an idea how to make use the views of one report to other reports...?
    Thanks & Regards
    G. Kishore.

    Hi...
    I have achieved using Headers & Footers in another report through import formatting from another analysis option presents in compound layout view.
    But i unable to get the remaining views like static, Legend....etc. into another reports....
    Can anybody help me in doing this...
    Thanks & Regards
    G. Kishore

  • HT1449 how do you move all music from two computers into one itunes account?

    How do you move all music from two computers into one itunes account?

    An "iTunes account" is an online account you use for buying music, like a bank account.  An iTunes collection is the media you see when you open iTunes. Which do you mean?
    If it is two computers, it would also help to know where these are located. Are they on the same local network? If they are, try Home Sharing (and you have control of both and you aren't just trying to get music fro your computer to your friend's computer in another state).  If they are not, you'll have to use an external hard drive or flash drive.
    Is this on a PC? Your computer information says Windows but you posted this in the iTunes for Mac forum.

  • How to get relationship between two  views in the  reports

    How to get relationship between two  views in the  reports, I am doing a deletion program , it is fully relates to views , how to get relationship between them in the reports

    Hi,
    Please explain your question in detail...what do you want to read ?
    If you want to know about the navigation links between the views then you can use APIs  like
    wdComponentAPI.getComponentInfo().findInWindows("windowName").getViewUsageByID("Name").getNavigationLinks();
    Iterate through the navigationLinkInfo from above collection and can read the other properties .
    I haven't tried the above , but it should work !!!
    Regards,Anilkumar

  • Why do we get the data from a view to a report.

    hi
    why do we get the data from a view to a report. is it possible to get the data from a view in all the cases?

    hi Jyotssna,
      Suppose you are planning to get the data from multiple tables then you got to specify seveal condtions and make use of joins which results in poor performance in fetching the data . In order to improve the performance we make use of views where the conditions of different tables are defined and the data is fetched accordingly.
    Regards,
    Santosh

  • I have an iPhone 4, My itunes are from two differnt accounts; one from when I was under my dads account, and the other is my own. My question is would I be able to sync and update my itunes on my MacBook without having all the new music erased.

    I have an iPhone 4, My itunes are from two differnt accounts; one from when I was under my dads account when i was younger, and the other is my own which i currently use. My question is would I be able to sync and update my itunes on my MacBook without having all the new music erased. I have the icloud on my phone, but I just want to update my music on my laptop. Just nervous to, because it has happened to me before on a desktop computer  and it *****. Please help! Thanks.

    nevermind, i figuered it out

  • Create a procedure which requires displaying information from two tables

    What if we want to create a procedure which requires displaying information from two tables. In this situation,
    I need to display all the details of an employee from an 'emp' table based on the deptno. and also their salary information which is
    stored in "Salgrade" Table. Is the use of "And" the correct way of using it?
    Do I need to declare all the attributes before begin or I can just access them directly? Thanks
    Create Procedure findDept
    ( I_deptno IN number
    ) As
    Begin
    Select Ename, Job, MGR, Hiredate, Sal, Comm, Dept_no from emp and exp, grade , location from salgrade where dept_no
    = I_Deptno;
    Exception
    When NO_Data_Found then
    DBMS_Output.Put_Line(' Department not found"|| I_deptno);
    End findDept;

    Hi,
    Besides Qwerty's remark, you've also got a quoting error:
    Change
    DBMS_Output.Put_Line(' Department not found"|| I_deptno);
    {code}
    into
    {code}
    dbms_output.put_line(' Department not found: '|| i_deptno);
    {code}
    Which leads to the question:
    What do you want to do when a record is found?
    Display it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Delete from two tables in one statement

    Hi,
    Is there a way to delete from two tables in one statement?
    Actually I have two tables:
    1. Base table (id, name, age)
    2. Person table (id, city, street)
    The id in both tables is identical.
    I would like to delete using something like a join:
    Delete from base, person where id=2;
    Thanks
    dyahav

    Hi,
    If you want to delete records both at a time them your table must use ON DELETE CASCADE. See the below example.
    CREATE TABLE supplier
    ( supplier_id numeric(10) not null,
    supplier_name varchar2(50) not null,
    contact_name varchar2(50),
    CONSTRAINT supplier_pk PRIMARY KEY (supplier_id)
    CREATE TABLE products
    ( product_id numeric(10) not null,
    supplier_id numeric(10) not null,
    CONSTRAINT fk_supplier
    FOREIGN KEY (supplier_id)
    REFERENCES supplier(supplier_id)
    ON DELETE CASCADE
    In this example, we've created a primary key on the supplier table called supplier_pk. It consists of only one field - the supplier_id field. Then we've created a foreign key called fk_supplier on the products table that references the supplier table based on the supplier_id field.
    Because of the cascade delete, when a record in the supplier table is deleted, all records in the products table will also be deleted that have the same supplier_id value.
    Thank you.

  • When setting up sync how does sync manage information from two computers? Does it merge the information?

    When setting up sync how does sync manage information from two computers? Does it merge the information?

    Hi!
    Yes, the way Sync works is that it puts all the Bookmarks together and pushes them to all your devices. Same with History.
    You will not loose any information in any of your computers.

  • Set two views in one portal page

    Hello all,
    I need to set two views in one portal page, or  tow deferent views have to be setted in one view, unfortunately i didn't find anythings in SAP forums about this subject
    please help me to reso

    Are you saying you have two separate WD Applications (both FPM) which you want to run as two iViews in the same Portal Page?  If so, this is a very basic NetWeaver Portal capability - to add more than one iView to a Page.  However this isn't the correct forum to discuss this, as that discussion would belong in the NetWeaver Portal Forum.
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/47/881b2a67731e1ee10000000a42189d/frameset.htm

  • I need two query in one report (two detail section in one query)

    Hi master sorry for again distribute
    Sir I need two query in one report
    Because I need two detail section in my one report
    Such as
    Master
    Vno=9088989
    Detail          1
    =
    =
    ==
    =
    Total                     99999
    Detail          2
    =
    =
    ==
    =
    Total                     33333
    Sir how I get this type of report
    Please give me idea
    Thanking you
    Aamir

    I want to see the report as follow.
    d_name: CPU-1
    date: -----------
    Software installed:
    sw_id, software, version, serial_no, sw_type
    (list of softwares attached, can be more then one)
    Hardware attached:
    hw_id, hardware, specification (same like software list, it will contain hardware list attached to specific device),
    Please if you can help me that how will i make a query for this.
    Thanks and Regards
    Maz

  • Best way to join information from two datasources??? pls help

    Guys Please help in understanding the basics of modelling in terms of best practises in SAP-BI
    I have two datasources. One is standard Bussiness content datasources 2LIS_02_ITM ( having PO item level data)  and the other is a generic datasource on table EBAN (having PR details). Now all my report requirements are on both PO and PR information.So i need to club these datasources or its corresponding DSO's  or its corresponding cubes.
    Please suggest the best of the following solutions:
    solution 1 and 2
    2LIS_02_ITM -
    > DSO1 -
    > PO cube
    Gener Datasourceon EBAN -
    > DSO2----
    > PR Cube
    solution one is to go and build multiprovider joining with PR no in either cubes
    solution two is to go and build infoset joining with PR no in either cubes
    solution 3
    2LIS_02_ITM -
    > DSO1 -
    > cube
    Gener Datasourceon EBAN -
    > DSO2
    while populating data from DSO1 to cube we lookup on to DSO2 and read the PR data , thus consolidating both PR and PO data in the cube
    solution 4
    Here i can plan to combine two datasources 2LIS_02_ITM ,Gener Datasourceon EBAN into one infosource.
    (2LIS_02_ITM ,Gener Datasource on EBAN)---->infosource->DSO-->cube
    solution 5
    i can club both PO and PR information at the  r/3 side only into a  view and build a  generic datasource on that... then bring the whole data into one DSO and cube and report on that....
    Please do help me guys.... i will award points to all who adds some imp information.

    Hello Venkata
    We use approach
    1/2 when we have different data comming fromsource and data amount is huge and lot of transformation is there
    3 You can use this approach here but lookup in other ODS is also time consuming also any changes which may be done in future wouldd need corresponding changes in the ODS
    4. We should always use infosource even if BI/7 as it provides very much flexibility and scalability...but when u r combining these two DS you need to make sure u r extracting proper record
    I dont know if you are talking abt extractor enhancement in this point...i would suggest if no. of field to be enhanced is less than u can go for it...
    5. IOfcourse u can create a view but its better to enhance extractor becuae SAP has already provided DS for 2LIS_02_ITM...
    We have done the same thing but we were having only 7-8 PR fields ...so we just enhanced the structure.......
    Thanks
    Tripple k

  • Crystal Reports - Two Tables in one report, grouped by machine.

    I have two tables for machine schedules.  One is a Current Job Table, and the other is a Que Job Table.  I do have tables joined to a definition table for the machine name.
    Cur Job Table - Def table
    Que Job Table - Def table
    I want to report the information from the current job table for each 13 machines in sequence.  Some machines may have more current jobs than qued jobs.
    ...Machine 1 (Machine Name)
    .....Current Jobs (Cur Job Table)
    .....Qued Jobs (Que Job Table)
    ...Machine 2 (Machine Name)
    .....Current Jobs (Cur Job Table)
    .....Qued Jobs (Que Job Table)
    Etc.
    Is there a way to do this easily?  I have tried grouping and sub reports.  Seems like I end up with duplicate records due to the SQL joins.

    Sharon,
    Select distinct will not work here, as select distinct checks all fields in the record, and when joining the two detail tables, it will not clear out "duplicates" on only one side of the join.
    I would also humbly suggest that using Select Distinct to try to "clean up" a query is rather dangerous.  You may end up dropping some data that should appear on the report.  (In fact I recently had to fix a report due to this issue - coded by someone else, of course!  :->)  If you are getting duplicate records and you don't want them, the query should be coded to produce the desired result set WITHOUT the Distinct clause being the reason duplicates are dropped.  (This is not to say that select distinct is not useful, or should never be used.  If you need a distinct list of customers over a date range, using Select Distinct custcode from sales where date between {?start} and {?end} is perfectly OK.)
    HTH,
    Carl

  • SSAS Tabular - Merge data from two tables to one

    Hi,
    I have two ReportServer databases in two different instances of SQL Server. I want to extract the ExecutionLog3 data to a Tabular model. Now, I have two separate tables in Tabular with duplicated measures but I want to have the data from two ReportServer in
    the same table.
    Any idea?
    Regards.

    Hi Numero4,
    According to your description, there are two Reporting Services databases, and you want to merge the data in a tabular model, right? 
    As per my understanding, you can create a link server on one of the server, and then merge the data in database lever other than in tabular mode. In this case, import the merged data into the tabular model. Here are some useful links for you reference.
    http://msdn.microsoft.com/en-IN/library/ff772782.aspx
    http://support.flexquarters.com/esupport/index.php?/Default/Knowledgebase/Article/View/2458/52/how-to-create-link-server-with-ms-sql-200520082012-64-bit-using-qodbcqremote
    Regards,
    Charlie Liao
    TechNet Community Support

  • BLOBs from different tables on one report

    Hi,
    I think the declarative BLOB support enhancement in 3.1 is really great. I am running into a problem with a report that joins two tables that both have BLOB columns. I have a Letters table and a Response table. The Response table has a FK linkage to the Letters table with the Letters table being the referenced table. I have a report that joins the Letters & Response tables and provides download links for the BLOBs in both tables. However on the report, only one of the link works at a given point in time. Both the links work fine in isolation (if the other link is commented out in the query).
    I am using the APEX_UTIL.GET_BLOB_FILE_SRC function to download the files. Has anyone tried using this function to download files from two different tables in a single report?
    TIA,
    Ramesh

    Ramesh,
    Is this application on apex.oracle.com by any chance? I just went to test there and am having all sorts of trouble with declarative display of BLOBs in a report but on our dev box, two works fine (except that the link for both is the default rather than what I selected).
    -- Sharon

Maybe you are looking for