Query Not Returning Enough Records

have two tables that I am trying to join together. 
The first table shows the income for each department of the store broken down by period like this:
Store_Data:
Store_Type  Dept    Year  Period  Sales
Grocer      Produce   11  01      31865.00   
Grocer      Produce   11  02      32525.00   
Grocer      Produce   11  03      37490.00   
Grocer      Meat      11  01      224.00   
Grocer      Dairy     11  02      5850.00   
Grocer      Dairy     11  03      33209.92   
Grocer      Dry       11  03      1000.00
The second table contains a record for each store showing it's goal, like this:
Goal_Data:
Store_Type  Dept    Year  Amount
Grocer      Produce   11  157192.00
Grocer      Canned    11  0.00
Grocer      Paper     11  146820.00
Grocer      Meat      11  2168.00
Grocer      Dairy     11  50000.00
Grocer      Frozen    11  29464.00
Grocer      Pet       11  330096.00
Grocer      Dry       11  1716.00
Grocer      Pharmacy  11  0.00
Grocer      Misc      11  6668.00
Now, I have a query to join the two tables.  What I want is for all the records in the second table, whether or not there is a corresponding record in the first (such as 'Meat' and 'Dairy').
I have to filter on Store_Data.Store_Type, Store_Data.Year, Store_Data.Period
Crystal is outputting the following SQL:
SELECT DISTINCT
    Store_Data.Store_Type,
    Store_Data.Dept,
    Store_Data.Year,
    Store_Data.Period,
    Store_Data.Sales,
    Goal_Data.Amount
FROM  
    Store_Data
    RIGHT OUTER JOIN Goal_Data
        ON ((Goal_Data.Dept=Store_Data.Dept) AND
        (Goal_Data.Store_Type=Store_Data.Store_Type))
        AND (Goal_Data.Year=Store_Data.Year)
WHERE 
    Store_Data.Store_Type='Grocer'
    AND Store_Data.Year='11'
    AND (Store_Data.Period='01'
        OR Store_Data.Period='02'
        OR Store_Data.Period='03')
But I'm only getting the records from the Store_Data table (and records in Goal_Data where the "ON" fields match).  Testing in SQL Server verifies that the query is producing incorrect output.
What do I need to change to do what I'm wanting to do?

It looks like the thread is going to take a left turn just about now.
The problem appears to be that, for the query to work properly, the filter for the period has to be in the joins "ON" clause.
This I accept.
And, apparently, trhe only way to get a parameter value to go into that area is by using a stored procedure.
To that end, I have created a Stored Procedure which takes three parameters, "Store_Type", "Year", and "Quarter"
I have verified that the results are what I need.  I plugged the stored procedure into my report (which is technically a sub-report) and it asked me for the values of the parameters.  Entering them in, I do get a result that I would expect.
Everything good so far.
Now, about those parameters (both for the Storeed Procedure as well as the report).  As I said, the report that I have been working is actually a sub-report, one of five which will be on the main report.  Each report will require the same three parameters, two of which (year and quarter) need to be selected by the user and will feed the same values to all five sub-reports.  The third parameter should be "hard-coded" to each particular sub-report.
Now for the issue (the main point being that I am unfamiliar with CR and Stored Procedures)...
The way things are going now, when all is said and done, it looks like the user will be required to enter in the year and quarter for each sub-report (the Store_Type will be there too, but it will have a default value).  That's the user typing in '2012' for the year five times and '1' for the quarter five times.  This is unacceptable.
So, how do I create a single Year parameter and a single Quarter parameter that will feed all five reports?
Apparently trying to code it in the Report Selection Formula is not the right path.
So, can someone either walk me through the process, or point me to a tutorial where the process is explained?
TIA

Similar Messages

  • 8i Query not returning expected records

    Using Oracle 8i (8.1.7), a basic spatial query is not returning all the expected results. Table1 contains a variety of polygons; table2 is simply a set of rectangles. I want to return all objects from table1 that intersect a particular rectangle. The query below mostly works, but misses out some objects. On my system, 38 objects are returned where about 41 are expected; on the client system (which does not have identical data) the problem appears to be much worse, with hardly any objects being returned. The missing objects are clearly visible on the map, surrounded on all sides by objects which have been selected correctly. Help?
    Select t1.id from table1 t1, table2 t2
    where t1.IsCurrent = -1
    and (sdo_relate(t1.geoloc, t2.geoloc, 'mask=ANYINTERACT querytype=WINDOW') = 'TRUE')
    AND (t2.ID in ('001'));

    Hi,
    When the non-spatial predicate is dropped, you mentioned the
    objects are not missing. This means the spatial index (which will
    surely be used in this case) should be returning correct results.
    But it is possible the index is not used when other predicates are
    specified. Please look at the "execution plan" in both cases (when the
    objects are missing/not missing).
    Rewrite the query as:
    select /*+ ORDERED INDEX(t1 <spatial_index_name>) */ t1.id from t2, t1
    This should ensure a spatial-index-based evaluation.
    Let us know the execution plans and the behavior in either case.
    Btw, one thing to check is your tolerance values in
    user_sdo_geom_metadata.
    - Ravi.

  • Query is returning multiple records for a bank account id and party id

    Hi All,
    I am not getting why this query is returning multiple records for a particular bank account id and party id:
    SELECT instrument_payment_use_id
    ,instrument_type
    ,instrument_id
    ,start_date
    ,ext_pmt_party_id
    FROM iby_pmt_instr_uses_all
    WHERE instrument_id =:lv_num_ext_bank_account_id
    and exists (select 1 from iby_external_payees_all b where PAYEE_PARTY_ID= :lv_num_party_id and b.ext_payee_id = ext_pmt_party_id)
    I want above values to be used in api iby_disbursement_setup_pub.set_payee_instr_assignment in R12.
    Please help asap.
    Thanks

    O/P of query run for
    SELECT rowid, instrument_payment_use_id
    FROM iby_pmt_instr_uses_all
    WHERE instrument_id =6642
    AND EXISTS (
    SELECT 1
    FROM iby_external_payees_all b
    WHERE payee_party_id= 85470
    AND b.ext_payee_id = ext_pmt_party_id);
    is below:
    Rowid     INSTRUMENT_PAYMENT_USE_ID
    AABiDXAGIAABhiKAAS     236586
    AABiDXAGRAABSjtAAz     148437
    The version is R12

  • 'Query not returning string values as expected

    Hi
    Why would this be happening?
    I have an insert statement that looks like this;
    UNION ALL
    SELECT '59','','last','first','','','','WILLIAMTA','BEB92C5B52566E6594707C69729624BE','','','Senior Officer','Town Name','2','','SUSTAINABLE FOREST MANAGEMENT DIVISION','NAME BRANCH','CURRENT' FROM DUAL
    ...I then want to create an conditional display statement in an apex application that looks like this;
    PLEASE NOT I HAVE REPLACED (the symbols that will not render for not equal to) WITH THE TEXT "NOT EQUAL TO"
    SELECT USERNAME
      FROM sfm_common.sct_parties
    WHERE division NOT EQUAL TO 'SUSTAINABLE FOREST MANAGEMENT DIVISION'
       AND username = :app_userBut it doesnt return anything and I know it should so I do some tests, below;
    1. You will see the first statement returns no records.
    2. In the second statement there is a space between N and the quote, and it returns a record
    3. In the third test if I make the gap really big it still returns a value.
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 8 14:27:55 2009
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    SQL> SELECT DISTINCT null
      2    FROM sfm_common.sct_parties
      3   WHERE division NOT EQUAL TO 'SUSTAINABLE FOREST MANAGEMENT DIVISION'
      4  /
    no rows selected
    SQL> SELECT DISTINCT null
      2    FROM sfm_common.sct_parties
      3   WHERE division NOT EQUAL TO 'SUSTAINABLE FOREST MANAGEMENT DIVISION '
      4  /
    N
    SQL> SELECT DISTINCT NULL
      2    FROM sfm_common.sct_parties
      3   WHERE division NOT EQUAL TO 'SUSTAINABLE FOREST MANAGEMENT DIVISION                 '
      4  /
    N
    SQL>Would anyone know why this has happened, I have checked my insert scripts and there is no space at the end of the text in the column named 'division'.
    Ben
    Edited by: Benton on Sep 8, 2009 2:59 PM

    The table contains attributes like this;
    Col_1
    TOMATO
    ORANGE
    APPLE
    NULLSo what I was attempting to do was something like this;
    SELECT col_1 FROM table WHERE col_1 != 'TOMATO'
    I would then expect to see;
    Col_1
    ORANGE
    APPLE
    NULLBut instead I had the following returned;
    no rows selected
    Which is not correct.
    Apparently the fact that the column is 255 characters long is causing a problem, but I really dont understand why because I have other tables where I execute columns that are not the exact length of the content and yet the sort of query that I have used as an example work perfectly fine. For example;
    SQL> SELECT name
      2    FROM table_name
      3   WHERE name != 'HYGIENE MANAGEMENT'
      4  /
    NAME
    ACTION
    APPROVALS
    AUDITING
    BURNING
    COLLECTION
    COMMUNICATION
    COMPLIANCE
    DEVELOPMENT
    DISTURBANCE
    DOCUMENT CONTROL
    ERADICATION
    11 rows selected.
    SQL>And the ddl for the table looks like this;
      CREATE TABLE "TABLE_NAME"
       (     "ACT_ID" NUMBER,
         "NAME" VARCHAR2(50 BYTE) NOT NULL ENABLE,
         "CREATED_BY" VARCHAR2(50 BYTE) DEFAULT 'USER',
         "CREATED_ON" DATE DEFAULT SYSDATE,
         "EFF_FROM" DATE DEFAULT SYSDATE,
         "EFF_TO" DATE,
         "DEFINITION" VARCHAR2(4000 BYTE),
         "STATUS" VARCHAR2(15 BYTE) DEFAULT 'CURRENT' NOT NULL ENABLE,
          CONSTRAINT "TABLE_NAME_CHK1" CHECK ( status IN ('CURRENT','NOT CURRENT')) ENABLE,
          CONSTRAINT "TABLE_NAME_PK" PRIMARY KEY ("ACT_ID");The name field in this instance is 50 characters long and the words 'HYGIENE MANAGEMENT' make up 18 characters.
    Ben

  • Query not fetched the record

    Hello,
    Could someone help me please ?
    I have a listing of my sales orders and I want to make changes in my order by opening the form and fetched with that record. When I click on that particular orderno in my listing of order and call the form to display the details, it calls the form but says "Query could not fetch the record". I do not know why ? Please help me with the solution.
    Thanx

    Hello,
    I think you are passing orderno to called form as a parameter. If you are using parameter list check..
    1. If parameter data is getting in form correctly ?
    2. Next, have you changed where clause of other block,so that is will display record with passed orderno ?
    I am expecting more details from you.
    Thanx
    Adi

  • Query not returning any rows?

    hi experts,
    My query running long but not returning any result. i have data , no locks on the tables.
    i have bigger ( hardware ) database on different server , where I can get results with same query.
    Can you tell me what are the DB settings i have to look at to resolve this issue?
    ( any sql query that can monitor these parameters ?)
    (the tabels involved in this query has 33milliions, 2millions, 7 milllions )
    Thanks ..
    Edited by: 642877 on Sep 21, 2011 6:46 PM

    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE     11.2.0.2.0     Production"
    TNS for Solaris: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    ==========================================================
    Plan hash value: 3185710999
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 3 | 423 | 24592 (2)| 00:05:45 | | |
    | 1 | HASH GROUP BY | | 3 | 423 | 24592 (2)| 00:05:45 | | |
    | 2 | NESTED LOOPS | | | | | | | |
    | 3 | NESTED LOOPS | | 3 | 423 | 24591 (2)| 00:05:45 | | |
    | 4 | NESTED LOOPS | | 3 | 345 | 24585 (2)| 00:05:45 | | |
    | 5 | NESTED LOOPS | | 1 | 84 | 21916 (2)| 00:05:07 | | |
    | 6 | NESTED LOOPS | | 1 | 67 | 21915 (2)| 00:05:07 | | |
    | 7 | PARTITION LIST ALL | | 2 | 60 | 21913 (2)| 00:05:07 | 1 | 11 |
    |* 8 | TABLE ACCESS FULL | ART_CRDT_ACCT_FACT | 2 | 60 | 21913 (2)| 00:05:07 | 1 | 11 |
    |* 9 | TABLE ACCESS BY INDEX ROWID| ART_PRTFOL_GRP_DIM | 1 | 37 | 1 (0)| 00:00:01 | | |
    |* 10 | INDEX UNIQUE SCAN | ART_PRTFOL_GRP_DIM_INDEX1 | 1 | | 0 (0)| 00:00:01 | | |
    | 11 | TABLE ACCESS BY INDEX ROWID | W_MONTH_D | 1 | 17 | 1 (0)| 00:00:01 | | |
    |* 12 | INDEX UNIQUE SCAN | UQ_W_MONTH_D | 1 | | 0 (0)| 00:00:01 | | |
    | 13 | PARTITION LIST ITERATOR | | 3 | 93 | 2669 (2)| 00:00:38 | KEY | KEY |
    |* 14 | TABLE ACCESS FULL | ACCT_CLTRL_RLTNP | 3 | 93 | 2669 (2)| 00:00:38 | KEY | KEY |
    |* 15 | INDEX UNIQUE SCAN | UQ_ART_CLTRL_DIM | 1 | | 1 (0)| 00:00:01 | | |
    | 16 | TABLE ACCESS BY INDEX ROWID | CLTRL_DIM | 1 | 26 | 2 (0)| 00:00:01 | | |
    -------------------------------------------------------------------------------------------------------------------------------

  • Basic NOT EXISTS query not returning any results

    DB Version: 10gR2
    One of our tables in the test schema is having less number of columns than the PROD shema.
    To determine which are missing columns in this table in Test schema i did the following.
    -----In Test Schema
    CREATE TABLE XYZ2
    (COL1 NUMBER);        ----------only one column
    SQL > CREATE TABLE tables_test_list AS SELECT TABLE_NAME,COLUMN_NAME FROM USER_TAB_COLS;
    Table created.--- In the prod schema
    SQL> CREATE TABLE XYZ2
      2  (COL1 NUMBER,
      3  COL2 NUMBER       ----------- same table name with an extra column
      4  );
    Table createdAnd from the PROD schema i execute the following SQL to determine what are the columns that are missing in the TEST schema
    select column_name from User_Tab_Cols  outer
    where table_name='XYZ2'
    and not exists (select 1 from TEST_SCHEMA.tables_test_list inner where outer.TABLE_NAME=inner.TABLE_NAME )But the above query is not returning any results. Any idea why?

    Actually, the example from the link I posted earlier:
    [email protected]> (
      2  select 'IN T1, NOT T2', column_name,data_type,data_length
      3    from user_tab_columns
      4   where table_name = 'T1'
      5  MINUS
      6  select 'IN T1, NOT T2', column_name,data_type,data_length
      7    from user_tab_columns
      8   where table_name = 'T2'
      9  )
    10  UNION ALL
    11  (
    12  select 'IN T2, NOT T1', column_name,data_type,data_length
    13    from user_tab_columns
    14   where table_name = 'T2'
    15  MINUS
    16  select 'IN T2, NOT T1', column_name,data_type,data_length
    17    from user_tab_columns
    18   where table_name = 'T1'
    19  )
    20  /

  • Query not returning all data

    All,
    I have 2 dimension tables and 1 logical fact table
    a01_bi_agency_interest_dim
    a01_bi_dsk_central_file_dim
    tier2_facts
    1 Complex Join in Physical Layer
    A01_BI_AGENCY_INTEREST_DIM.MASTER_AI_ID = A01_BI_DSK_CENTRAL_FILE_DIM.MASTER_AI_ID AND A01_BI_AGENCY_INTEREST_DIM.INT_DOC_ID = A01_BI_DSK_CENTRAL_FILE_DIM.INT_DOC_ID
    2 Logical Joins in BMM
    A01_BI_AGENCY_INTEREST_DIM to tier2_facts (inner, 0 or 1 to many)
    A01_BI_DSK_CENTRAL_FILE_DIM to tier2_facts (inner, 0 or 1 to many)
    Query only returns 1 row. Should return many rows, I have checked the data through sql queries in SqlPlus.
    Query from advanced tab.
    SELECT A01_BI_AGENCY_INTEREST_DIM.MASTER_AI_NAME saw_0,
    A01_BI_DSK_CENTRAL_FILE_DIM.INT_DOC_ID saw_1
    FROM TIER2 ORDER BY saw_0, saw_1
    Any help would be appreciated. I am missing something, but doesn't make sense.
    Thanks,
    Kathy

    It doesn't do the join and I get 1 record returned with zero's for both values. Why doesn't it pick up my join?
    -------------------- SQL Request:
    SET VARIABLE QUERY_SRC_CD='Report';SELECT A01_BI_AGENCY_INTEREST_DIM.MASTER_AI_ID saw_0, A01_BI_DSK_CENTRAL_FILE_DIM.INT_DOC_ID saw_1 FROM TIER2 ORDER BY saw_0, saw_1
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- General Query Info:
    Repository: Star, Subject Area: TIER2, Presentation: TIER2
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- Cache Hit on query:
    Matching Query:     SET VARIABLE QUERY_SRC_CD='Report';SELECT A01_BI_AGENCY_INTEREST_DIM.MASTER_AI_ID saw_0,
    A01_BI_DSK_CENTRAL_FILE_DIM.INT_DOC_ID saw_1
    FROM TIER2 ORDER BY saw_0, saw_1
    Created by:     Administrator
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- Query Status: Successful Completion
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- Physical Query Summary Stats: Number of physical queries 1, Cumulative time 0, DB-connect time 0 (seconds)
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- Rows returned to Client 1
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- Logical Query Summary Stats: Elapsed time 0, Response time 0, Compilation time 0 (seconds)

  • IPTObjectManager.Query not returning correct result (Java)

    Hi,
    I am having a problem with the IPTObjectManager.Query method. The code is given below. The issue I am having is, that when I search for a community in a specific folder not results are returned. However if I search in all folders (using -1 as the second parameter to the method) it returns multiple communities including the one I need. Anyone else had the same issue with this??
    // THIS CODE WORKS AND RETURN MULTIPLE COMMUNITIES
    // THE hotelCode VARIABLE IS A STRING VARIABLE CONTAINING A VALUE
    // WHICH IS THE COMMUNITY NAME.
    // Create a ObjectManager object
    IPTObjectManager objectManager = session.GetObjectManagers(ObjectClass.Community.toInteger());
    // define the query based on the passed string
    Object[][] vQueryFilter = {
         new Object[]{new Integer(PT_PROPIDS.PT_PROPID_NAME)},
         new Object[]{new Integer(PT_FILTEROPS.PT_FILTEROP_CONTAINS)},
         new Object[]{hotelCode}};
    // Run the query and return results
    IPTQueryResult ptQueryResult = objectManager.Query(
         PT_PROPIDS.PT_PROPID_ALL, -1, PT_PROPIDS.PT_PROPID_NAME, 0, -1, vQueryFilter);
    // THIS CODE DOES NOT WORK. I AM PASSING IS THE FOLDER ID OF THE
    // FOLDER WHICH CONTAINS THE COMMUNITY
    // Create a ObjectManager object
    IPTObjectManager objectManager = session.GetObjectManagers(ObjectClass.Community.toInteger());
    // define the query based on the passed string
    Object[][] vQueryFilter = {
         new Object[]{new Integer(PT_PROPIDS.PT_PROPID_NAME)},
         new Object[]{new Integer(PT_FILTEROPS.PT_FILTEROP_CONTAINS)},
         new Object[]{hotelCode}};
    // Run the query and return results
    IPTQueryResult ptQueryResult = objectManager.Query(
         PT_PROPIDS.PT_PROPID_ALL, 303, PT_PROPIDS.PT_PROPID_NAME, 0, -1, vQueryFilter);

    I don't know about G6, however in version 5 there does not appear an easy way of doing it. I guess the "easiest" way would be to query sub-folders first, build and array of their ids, and then query for communities in those folders. This is using server API. Something like this (.NET):
    publicvoidGetFolderCommunities(intfolderId){    IPTAdminFolder folder =this.session.GetAdminCatalog().OpenAdminFolder(folderId, false);    IPTQueryResult qr =folder.QuerySubfolders(PT_PROPIDS.PT_PROPID_ALL, [b]1, null, 0, -1, newobject[][] {             newobject[] { PT_PROPIDS.PT_PROPID_FOLDER_FOLDERTYPE }, newobject[] { PT_FILTEROPS.PT_FILTEROP_EQ } , newobject[] { PT_ADMIN_FOLDER_TYPES.PT_ADMIN_FOLDER_TYPE_COMMUNITYFOLDER } } ); int[] folderIds =newint[qr.RowCount()]; Console.WriteLine("------ sub-folders for communities -------"); for(inti =0; i <qr.RowCount(); i++) {        intobjectId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_OBJECTID);        stringobjectName =qr.ItemAsString(i, PT_PROPIDS.PT_PROPID_NAME);        intparentFolderId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_FOLDER_PARENTFOLDERID);        folderIds[i] =objectId; Console.WriteLine("{0}: {1}; parent: {2}", objectId, objectName, parentFolderId); } qr =this.session.GetCommunities().Query( PT_PROPIDS.PT_PROPID_ALL, -1, (object) null, 0, -1, newobject[][] {            newobject[] { PT_PROPIDS.PT_PROPID_FOLDERID }, newobject[] { PT_FILTEROPS.PT_FILTEROP_IN } , newobject[] { folderIds } } ); Console.WriteLine("------ communities from sub-folders -------"); for(inti =0; i <qr.RowCount(); i++) {        intobjectId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_OBJECTID);        stringobjectName =qr.ItemAsString(i, PT_PROPIDS.PT_PROPID_NAME);        int parentFolderId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_FOLDERID);        Console.WriteLine("{0}: {1}; folder: {2}", objectId, objectName, parentFolderId); }}
    Or you could use EDK RPC search. Again, in .NET:
    publicvoidSearchForCommunities(intfolderId){ IPortalSearchRequest searchRequest =this.ptSession.GetSearchFactory().CreatePortalSearchRequest(); searchRequest.SetObjectTypesToSearch(newObjectClass[] { ObjectClass.Community }); searchRequest.SetDocFoldersToSearch(newint[] {}, true); searchRequest.SetAdminFoldersToSearch(newint[] { folderId}, true); searchRequest.SetResultsCount(0, 100); searchRequest.SetResultsOrderBy(PortalField.OBJECT_ID); searchRequest.SetFieldsToReturn(newPlumtreeField[] {}); searchRequest.SetQuery("*"); ISearchResponse searchResponse =searchRequest.Execute(); intreturnedMatches =searchResponse.GetReturnedCount(); ISearchResultSet resultSet =searchResponse.GetResultSet(); IEnumerator enumerator =resultSet.GetResults(); while(enumerator.MoveNext()) { ISearchResult result =(ISearchResult) enumerator.Current; Console.WriteLine( result.GetFieldAsInt(PortalField.OBJECT_ID) +": "+ result.GetFieldAsString(PlumtreeField.NAME) ); }}
    Ruslan.

  • Personnel Admin AdHoc Query not retrieving all records

    Hi, I recently added a custom info type to a copy of the SAP ad hoc query for Personnel Admin by using the menu path in SQ02>Edit>Change Infotype selection . The query is picking up the new info type and runs fine but does not retrieve all records from the table for a given personnel id. It only retrieves 1 record per id.
    Has anyone dealt with this before and have an easy/quick fix for this?

    Have other users try the query, preferably a user with end user authorization.
    I've had this issue before, I'm an IT person and I customized a Standard infoset.
    During testing, I'm only getting 1 (in my case) Insurance record per employee.
    The end user can see multiple record per employee.
    Btw, did you customize a Global or a Standard Infoset?
    Regards,
    Olekan

  • A Simple Linq Query to return a Record from SQL Server

    I have a table named Customers which contain columns like
    Id   Col1   Col2   Col3   Col4   Col5
    How do I write a Linq query to return the value of Col2 where Id=999

    Hello,
    It depends on what method you use to read data i.e. Data Context class, Entity Framework for SQL-Server we can get data directly from the database easily.
    The following has two very simply examples using data context classes and the same came be done with Entity Framework which has an even more powerful version of data context implementation under 6 and above
    Dim db As New DataClasses1DataContext
    Dim theCustomer As Customer = db.Customers.Where(Function(c) c.CustomerID = 999).FirstOrDefault
    If theCustomer IsNot Nothing Then
    ' use theCustomer which contains all columns
    Else
    ' do not use, customer not located
    End If
    Dim theCustomer1 As Customer =
    From c In db.Customers
    Where c.CustomerID = 999
    Select New Customer With
    .CompanyName = c.CompanyName,
    .ContactName = c.ContactName,
    .Orders = c.Orders
    ).FirstOrDefault
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • Query not returning rows (nvl)

    Hi all, I was wondering if anyone could help
    I have a query :
    select a, b, c, d, e from table_t
    where a=nvl(:para, a)
    and b=nvl(:parb,b)
    and c=nvl(:parc,c)
    the problem is is one the rows contain a null, then that row is not returned. I would like to return all rows along with the null values.
    for example:
    row 1 has b= null then row 1 is not displayed but only the rest of the rows where b is not null are displayed
    DB version 11.1.0.6.0 g
    All help will be appreciated.
    Kind regards,
    Cleopatra

    Hi, Cleo,
    Cleopatra wrote:
    Hi Frank ,
    thanks for the reply
    I get all the rows displayed now, but the filters do not seem to work for para, parb and parc.
    Any ideas how I could get that?Before moving on to other ideas, let's try the ideas I already mentioned:
    Frank Kulash wrote:
    ... post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data. Make sure the data shows special situations you care about, for example, if a is NULL, but :para is not NULL.
    Explain, using specific examples, how you get those results from that data.
    In problems like this, it often helps to know if there are impossible values for any of the columns. For example, if a is a DATE, it could be helpful to know if all dates stored in the table are after the year 1000, or, if b is a NUMBER, that it is always in the range -100 to +100.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}If the problem includes parameters (such as :para and :parb), then post a few sets of parameters and the results you want from the same sample data for each set.
    Simplify the problem if you can. For example, instead of comparing 3 columns to 3 paramaeters, could you illustrate the problem just as well with 2 columns and 2 parameters, or even 1 column and 1 parameter?

  • Query not displaying all records when execute it first tme

    Hello,
    i have an issue with the WEBI report.when i run  the report first time it's displaying only few records, but when i run the same report second time it's displaying the more records and it's correct.
    Could any one tell me why it's not displaying all records when i execute first time.
    Thanks in advance for your help.
    Regards,
    Prathap

    Which BOBJ version do you use?
    Which kind of data source are you retrieving data from?
    Regards,
    Stratos

  • FDM for PBCS - Drill Thru does not return any records in landing page

    This is referring to the Data Management functionality in PBCS, not on-premise FDMEE.
    I loaded in a file, for example:
    Region|Product|Account|Amount
    10|100|1000|9,000
    10|100|1000|1,000
    In FDM, I am using a multi dimensional map to derive another field. For example, if Region is 10 and Product is 100, than Department = 555.
    so in FDM, I would end up with
    10|100|1000|555|9,000
    10|100|1000|555|1,000
    Once loaded to PBCS, that loads in as:
    10|100|1000|555|10,000
    I built a form that shows this intersection, and then 'drilled to source'. When I get to the FDM landing page, there are no records shown. Is this because the derived field (department) does not exist in the source, or am I doing something wrong?
    Appreciate any help.

    Do you have access to the server logs by any chance?
    Can you check the dimension class for your Scenario dimension in your target application? is it set to SCENARIO?
    not showing source records is typically related to FDMEE not finding values in TDATASEG table.
    HTH

  • Query not returning correct number of records

    Hi Guys,
    Can someone please tell me why this query is not retrieving the correct number of records.
    I have a table with six users
    FIRST_NAME          LAST_NAME
    David               Robert
    Martin               Fisher
    Henry               Robert King
    Edmund               Tomkinson
    Williams          Hayes Robert
    Tina               Belkins
    When I run a query, SELECT * FROM USERS WHERE LAST_NAME LIKE 'Robert';
    I only get 1 record back (David Robert). Is the space between the last name
    causing this? If yes, How can I rewite the query?

    show a copy-paste example of your query...
    you need to use a wild card with LIKE, as in
    SQL> create table test
      2  (first_name varchar2(50)
      3  ,last_name varchar2(50)
      4  );
    Table created.
    SQL>
    SQL> insert into test values ('David' , 'Robert'           );
    1 row created.
    SQL> insert into test values ('Martin', 'Fisher'           );
    1 row created.
    SQL> insert into test values ('Henry' , 'Robert King'      );
    1 row created.
    SQL> insert into test values ('Edmund', 'Tomkinson'        );
    1 row created.
    SQL> insert into test values ('Williams',  'Hayes Robert');
    1 row created.
    SQL> insert into test values ('Tina',  'Belkins');
    1 row created.
    SQL>
    SQL> SELECT * FROM test WHERE LAST_NAME LIKE 'Robert';
    FIRST_NAME
    LAST_NAME
    David
    Robert
    SQL>
    SQL> SELECT * FROM test WHERE LAST_NAME LIKE '%Robert%';
    FIRST_NAME
    LAST_NAME
    David
    Robert
    Henry
    Robert King
    Williams
    Hayes Robert

Maybe you are looking for

  • Abap-- urgent

    hi all..         can any one provide me with the links od the site tat provide me with the abap tips on performance tuning in abap,reports, ALV smart forms,IDOC, DDIC objects .. and entire abap.. thnx

  • SQL Developer High Memory Consumption 3.2.20.09.87

    Hello, I have been using SQL developer for quite some time and had initially had problems in the past with high memory consuption when I use this tool. I have received and applied advice from this forum and while it had helped a little, the majority

  • NPE when selected side left empty in Ordered Shuttle

    When all the entries from the shuttle we have created are moved from the Selected Side to the Available Side...and when we try to save it using a button, the following error is shot: "ADF_FACES-60097: Server Exception during PPR, #2" and the log entr

  • TS1702 Troubleshooting Apps

    I can't get my running apps to close on a brand new IPad Mini. I've done what they user guide tells you to do to force the app to close, but that's not working. Did anyone else have this proble.

  • Do I need to Log off iMessage and iTune before erasing MacBook?

    I am selling my MacBook with Yosemite installed. I have been using iMessage and iTune, but erased the hard disk before logging off iMessage and iTune. It now starts in a setup screen as factory setting. Do I still need to setup and manually log off?