Query with aggregate on custom mapping returning wrong type

I've got a JDOQL query that returns the sum of a single column, where that
column is custom-mapped, but the result I get back is losing precision.
I create the JDOQL query as normal and set the result to the aggregate
expression:
KodoQuery query = (KodoQuery) pm.newQuery(candidateClass, filter);
query.setResult("sum(amount)");
I can also setUnique for good measure as I am expecting just 1 row back:
query.setUnique(true);
The query returns an Integer, but my amount column is a decimal with 5
digits after the decimal point. If I ask for a Double or BigDecimal as the
resultClass, it does return an object of that type, but loses all
precision after the decimal point:
query.setResultClass(BigDecimal.class);
The amount field in my candidate class is of the class Money, a class that
encapsulates a currency and a BigDecimal amount. See
http://www.martinfowler.com/ap2/quantity.html
It is mapped as a custom money mapping to an amount and currency column,
based on the custom mapping in the Kodo examples. I have tried mapping the
amount as a BigDecimal value, and querying the sum of this works. So the
problem seems to be the aggregate query on my custom mapping. Do I need to
write some code for my custom mapping to be able to handle aggregates?
Thanks,
Alex

Can you post your custom mapping?
Also, does casting the value have any effect?
q.setResult ("sum((BigDecimal) amount)");

Similar Messages

  • Query with aggregates over collection of trans. instances throws an error

    Hi, I'm executing a query with aggregates an it throws an exception with the following message "Queries with aggregates or projections using variables currently cannot be executed in-memory. Either set the javax.jdo.option.IgnoreCache property to true, set IgnoreCache to true for this query,
    set the kodo.FlushBeforeQueries property to true, or execute the query before changing any instances in the transaction.
    The offending query was on type "class Pago" with filter "productosServicios.contains(item)".
    The class Pago has the field productosServicios which is a List of Pago$ItemMonto, the relevant code is :
    KodoQuery query = (KodoQuery)pm.newQuery(Pago.class,
    pagos);
    where pagos is a list of transient instances of type Pago.
    query.declareVariables("Pago$ItemMonto item");
    query.setFilter("productosServicios.contains(item)");
    query.setGrouping("item.id");
    query.setResult("item.id as idProductoServicio,
    sum(montoTotal) as montoTotal");
    query.setResultClass(PagoAgrupado.class);
    where the class PagoAgrupado has the corresponding fields idProductoServicio and montoTotal.
    In other words, I want to aggregate the id field of class ItemMonto over the instances contained in the productosServicios field of class Pago.
    I have set to true the ignoreCache and kodo.FlushBeforeQueries flags in the kodo.properties file and in the instances of the pm and the query but it has not worked, what can be wrong?.
    I'm using Kodo 3.2.4, MySQL 5.0
    Thanks,
    Jaime.
    Message was edited by:
    jdelajaraf

    Thanks, you nailed it! I tried comparing the two files myself, but Bridge told me that the 72.009 dpi document was 72 dpi.
    I have no idea why the resolution mess things up, but as long as I know how to avoid the bug, things are grand!

  • Update of a table from a select query with aggregate functions.

    Hello All,
    I have problem here:
    I have 2 tables A(a1, a2, a3, a4, a4....... ) and B( a1, a2, b1, b2, b3). I need to calculate the avg(a4-a3), Max(a4-a3) and Min(a4-a3) and insert it into table B. If the foreign keys a1, a2 already exist in table B, I need to do an update of the computed values into column b1, b2 and b3 respectively, for a1, a2.
    Q1. Is it possible to do this with a single query ? I would prefer not to join A with B because the table A is very large. Also columns b1, b2 and b3 are non-nullable.
    Q2. Also if a4 and a3 are timestamps what is the best way to find the average? A difference of timestamps yields INTERVAL DAY TO SECOND over which the avg function doesn't seem to work. The averages, max and min in my case would be less than a day and hence all I need is to get the data in the hh:mm:ss format.
    As of now I'm using :
    TO_CHAR(TO_DATE(ABS(MOD(TRUNC(AVG(extract(hour FROM (last_modified_date - created_date))*3600 +
    extract( minute FROM (last_modified_date - created_date))*60 +
    extract( second FROM (last_modified_date - created_date)))
    ),86400)),'sssss'),'hh24":"mi":"ss') AS avg_time,
    But this is very long drawn. Something more compact and efficient would be nice.
    Thanks in advance for your inputs.
    Edited by: 847764 on Mar 27, 2011 5:35 PM

    847764 wrote:
    Hi,
    Thanks everyone for such fast replies. Malakshinov's example worked fine for me as far as updating the table goes. As for the timestamp computations, I'm posting additional info: Sorry, I don't understand.
    If Malakshinov's example worked for updating the table, but you still have problems, does that mean you have to do something else besides update the table? If so, what?
    Oracle version : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    Here are the table details :
    DESC Table A
    Name Null Type
    ID               NOT NULL NUMBER
    A1               NOT NULL VARCHAR2(4)
    A2               NOT NULL VARCHAR2(40)
    A3               NOT NULL VARCHAR2(40)
    CREATED_DATE NOT NULL TIMESTAMP(6)
    LAST_MODIFIED_DATE TIMESTAMP(6) DESCribing the tables can help clarify some things, but it's no substitute for posting CREATE TABLE and INSERT statements. With only a description of the table, nobody can re-create the problem or test their ideas. Please post CREATE TABLE and INSERT statements for both tables as they exist before the MERGE. If table b doen't contain any rows before the MERGE, then just say so, but you still need to post a CREATE TABLE statement for both tables, and INSERT statements for table a.
    The objective is to compute the response times : avg (LAST_MODIFIED_DATE - CREATED_DATE), max (LAST_MODIFIED_DATE - CREATED_DATE) and min (LAST_MODIFIED_DATE - CREATED_DATE) grouped by A1 and A2 and store it in table B under AVG_T, MAX_T and MIN_T. Since AVG_T, MAX_T and MIN_T are only used for reporting purposes we have kept it as Varchar (though I think keeping it as timestamp would make more sense). I think a NUMBER would make more sense (the number of minutes, for example), or perhaps an INTERVAL DAY TO SECOND. If you stored a NUMBER, it would be easy to compute averages.
    In table B the times are stored in the format : hh:mm:ss. We don't need milliseconds precision. If you don;'t need milliseconds, then you should use DATE instead of TIMESTAMP. The functions for manipulating DATEs are much better.
    Hence I was calculating is as follows:
    -- Avg Time
    TO_CHAR(TO_DATE(ABS(MOD(TRUNC(AVG(extract(hour FROM (last_modified_date - created_date))*3600 +
    extract( minute FROM (last_modified_date - created_date))*60 +
    extract( second FROM (last_modified_date - created_date)))
    ),86400)),'sssss'),'hh24":"mi":"ss') AS avg_time,
    --Max Time
    extract (hour FROM MAX(last_modified_date - created_date))||':'||extract (minute FROM MAX(last_modified_date - created_date))||':'||TRUNC(extract (second FROM MAX(last_modified_date - created_date))) AS max_time,
    --Min Time
    extract (hour FROM MIN(last_modified_date - created_date))||':'||extract (minute FROM MIN(last_modified_date - created_date))||':'||TRUNC(extract (second FROM MIN(last_modified_date - created_date))) AS min_timeIs this something that has to be done before or after the MERGE?
    Post the complete statement.
    Is this part of a query? Where's the SELECT keyword?
    Is this part of a DML operation? Where's the INSERT, or UPDATE, or MERGE keyword?
    What are the exact results you want from this? Explain how you get those results.
    Is the code above getting the right results? Are you just asking if there's a better way to get the same results?
    You have to explain things very carefully. None of the people who want to help you are familiar with your application, or your needs.
    I just noticed that my reply is horribly formatted - apologies! I'm just getting the hang of it.Whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Query with dismantling process while Sales Return

    Hi Xperts
    We are doing Sales process in SAP as per the following way :
    Sale Order ->(BOM gets coppied for the finished prod) -> automatically Production order created while saving Sale order -> CO15 to confirm Prd Order -> Outbound Del -> PGI -> Billing.
    Now we want to have Sales Return process where we do not want that FG stock comes in to warehouse.We want directly Components stock should come & updated in the warehouse.How to achieve this ?
    More clearly stating that at the time of confirming Prd Order :
    FG : 101
    Component : 261
    We exactly want the reversal of the above during Sales Return.that is :
    FG : 102
    Component : 262
    Can we implement this for movement type 653?
    Regards
    Soumick

    done

  • DatabaseMetaData returning wrong types

    There seem to be a problem with JDBC returning the wrong column type. For oracle date columns I get a java.sql.Types.TIMESTAMP from getColumnType().

    Hmmm... unless there is something they are not telling us, I agree. The Timestamp is a composite of the Date type, but with resolution to the nanosecond.
    Perhaps they are planning to extend the date column functionality at some point to include this much resolution?
    null

  • Materialized view with aggregates doing a fast refresh

    why is that i need to have count(*),count(<expressions used>) in my Materialized view Query with Aggregates?
    say mat view query is:
    select deptno,sum(sal) from emp,dept where emp.deptno,dept.deptno group by dname.cant do a fast refresh.
    BUT
    select deptno,sum(sal),count(*),count(sal) from emp,dept where emp.deptno,dept.deptno group by dname.Does a fast refresh.Why?
    Also its mentioned in manuals that count(*) and count(expr) is needed but it doesnt explain why.
    Thanks

    Thanks for the correction.I just wanted to simulate the query and it was a typing mistake.sorry for that.
    My query working fine with count(). If i understand it correctly it is to determine whether there should be an update or delete to MV in case of say delete on master table.that is, count is decremented on delete and if it becomes 0 then we need to delete that aggregated row from the MV,else it need to be updated even in case of delete.
    But this answers why count() is needed for coulmns in group by clause.
    Dont really see a need to have count() in case i m updating the measures as materilized view logs should take care of it.

  • Query with || operator in IN clause

    Hi All,
    I am having two table emp_demo,dept_demo , below are the structure of the table :
    create table emp_demo(
    empno number primary key,
    ename varchar2(20),
    deptno number,
    dept_loc varchar2(20),
    dname varchar2(20)
    create table dept_demo(
    deptno number,
    dept_loc varchar2(20),
    dname varchar2(20)
    Query 1 :
    select * from emp_demo e where e.deptno||e.dept_loc||e.dname IN ( select d.deptno||d.dept_loc||d.dname from dept_demo d)
    Query 2 : 
    select * from emp_demo e where e.deptno  IN ( select d.deptno from dept_demo d)
    and e.dept_loc  IN ( select d.dept_loc from dept_demo d)
    and e.dname  IN ( select d.dname from dept_demo d)
    Could anyone please confirm that both the query will returns the same results in any condition.
    Thanks,
    Rajendra

    I agree with Karthick.
    Your query with || cannot be guaranteed to return the correct results, as it's possible that the concatenation of different strings could result in the same overall string
    As an illustrative example...
    if you have two strings... forename "FRED" and surname "SAMUEL BLOGGS" (very posh double barrelled surname)
    The concatenating these together can give us "FRED SAMUEL BLOGGS".
    Now what if the two strings we had were: forenames "FRED SAMUEL" and surname "BLOGGS"
    concatenating those together will also give us "FRED SAMUEL BLOGGS"
    So we had two lots of data, with different starting strings that resulted in the same overall string.
    In terms of your query, you should ideally join the data as Karthick showed, but just so you know, if you're wanting to do an IN clause on multiple columns, you do not concatenate the data together (it get's even more messy if the datatypes are different), but you actually treat all the columns as a set of data.  You do that using syntax like this...
    select *
    from emp_demo e
    where (e.deptno,e.dept_loc,e.dname) IN (select d.deptno,d.dept_loc,d.dname
                                            from   dept_demo d)
    Your second query is also completely different from the first query as it removes the relationship between the individual columns.  So, just because the dept_no is in the dept_demo table, and the dept_loc is also in the dept_demo table and the dname is also in the dept_demo table, doesn't mean that they all exist together on the same row of the dept_demo table.  I very much doubt that is what you wanted.
    SQL is set based.  That's a key thing to remember. 

  • Input Query with blanks when we press transfer values option

    I have an input query with 12 restricted key figures, but when I enter data and press on 'Transfer Values' or 'Save Values', the cells are blanked out (i.e. the values dissapear) and the data is not updated into the cube. I have done the following:
    In Query Designer, I have checked the attribute 'Start Query in Change Mode' and
    For all restricted key figures that needs to be planned, I have marked as 'Data can be changed using user entries and planning functions...'
    Can you please let me know your thoughts around this.
    Thanks,
    Srini

    Mayank,
    I have 10 characterstics(cost center, cost element, cost type, fiscal year period,fiscal year, version, value type, posting period, detail valye type, currency type+1kf(0amount)) in my aggregation level.
    I have created 12 rkf for each month with the following restrictions
    Plan rkf (sub rkf) with restrictions to
    fiscal year(variable), inforprovider-real time cube, value type 20, kf-0amount,
    jan plan rkf.....dec plan rkf has
    kf--Plan rkf(sub rkf) +  posting period 1...12(one for each month),
    And i have created an input query with the following fields
    unders rows
    Cost type, cost element
    under Columns
    Jan paln rkf to Dec plan rkf
    filters for controlling area EA
    I have change the query defination to "start query change mode" and also set all the rkf properties to "change by user enteries and/or planning options"
    So, is there anything i am missing here?
    Do i have to all characterstics of my aggregation level in my input query? or do i have to restrct my rkf to any curreny/unit fields? Please shed some light in here....:)
    Thanks for your help...
    Srini

  • File Error: Wrong type

    Hi,
    I have been archiving some old finished videos (as self-contained QTs) on a server that is PC based. I have a feeling that this may be a problem. I'm right, right?
    On a related note, I now have some QTs that will not open, with error messages like
    'File Error: Wrong type.' (FCP)
    and
    'Error opening movie
    The movie could not be opened.' (QT)
    The fun part is that I cannot remember exactly which had been moved over there (I had a couple LaCies die on me and in a rush transfered a bunch of stuff back and forth trying to stay ahead of the crash), but now they're back on Mac based externals. But won't open.
    Any advice is tremendously appreciated.
    Thanks,
    Ariel.
    Dual 1.8 GHz PowerPC G5   Mac OS X (10.3.9)   1 LaCie Big Disk Extreme, 1 Maxtor 500Gb, FCPHD 4.5, QT Pro 7.1.3

    Okay, thanks for the help. I'm pretty swamped right now, but by next Monday I will have gone through all of them. I will post back then with any info that may be of interest.
    So, for the future, I should either stay away from non Mac OS formatted drives for my media, or zip them before sending them over. (by control clicking and archiving)
    (sigh) Thanks, guys. I'm still just trying to figure out the cheapest, quickest way to archive my old stuff. I guess tape is the best way to go.
    - Ariel.

  • Simple query with like return wrong result

    Hi,
    I run simple query with like.
    If I use parameter I get wrong results.
    If I use query without parameter results are ok.
    My script:
    ALTER SESSION SET NLS_SORT=BINARY_CI;
    ALTER SESSION SET NLS_COMP=LINGUISTIC;
    -- drop table abcd;
    create table abcd (col1 varchar2(10));
    INSERT INTO ABCD VALUES ('122222');
    insert into abcd values ('111222');
    SELECT * FROM ABCD WHERE COL1 LIKE :1; -- wrong result with value 12%
    COL1
    122222
    *111222*
    select * from abcd where col1 like '12%'; -- result ok
    COL1
    122222
    I use Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    and query run in Oracle SQL Developer 3.1.07.

    Hi,
    welcome to the forum.
    When you put some code please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    You should specify exactly how you run your code.
    If I run this statement in SQL Plus:SQL> ALTER SESSION SET NLS_SORT=BINARY_CI;
    Session altered.
    SQL> ALTER SESSION SET NLS_COMP=LINGUISTIC;
    Session altered.
    SQL>
    SQL> -- drop table abcd;
    SQL> create table abcd (col1 varchar2(10));
    Table created.
    SQL>
    SQL> INSERT INTO ABCD VALUES ('122222');
    1 row created.
    SQL> insert into abcd values ('111222');
    1 row created.
    SQL>
    SQL> SELECT * FROM ABCD WHERE COL1 LIKE :1;
    SP2-0552: Bind variable "1" not declared.
    SQL>
    I got this error. So I wonder how you set value 12%
    Please specify exactly how you run your test as we cannot reproduce your problem.
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • SQL Query with wrong result

    Hello.
    I have a query with LEFT OUTER JOIN that I think returns invalid results. Here are the problem details:
    CREATE TABLE DOGERR(
    IdDog INTEGER,
    SfPdg CHAR(1),
    IdVpl INTEGER,
    SfVpGot INTEGER,
    SfZrr CHAR(1)
    INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (1, 'S', 1, 1, '7');
    INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (2, 'S', 1, 1, '7');
    INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (3, '$', 1, 2, 'C');
    COMMIT;
    CREATE UNIQUE INDEX DOGERR_PK ON DOGERR(IdDog);
    And now the query:
    SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
    FROM DOGERR D
    LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
    T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
    WHERE
    D.IdDog = 3
    AND D.SfVpGot = 2
    AND D.SfZrr = 'C';
    This query should (by my understanding) return only one row in wich the joined subquery columns should be NULL. And indeed query returns only one row on Oracle Database 10g Release 10.2.0.1.0 - Production and on Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production:
    IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = NULL, SFVPGOTJOIN = NULL, SFZRRJOIN = NULL
    But on Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production it returns TWO rows:
    IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = 1, SFVPGOTJOIN = 1, SFZRRJOIN = "7"
    IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = 1, SFVPGOTJOIN = 1, SFZRRJOIN = "7"
    And now the interesting part: any of the following modified versions of query works even on Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production, although modifications should not modify the result set:
    -- Removed unnecessary WHERE conditions
    SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
    FROM DOGERR D
    LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
    T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
    WHERE
    D.IdDog = 3;
    -- Removed unnecessary OR condition in subquery
    SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
    FROM DOGERR D
    LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S') T ON
    T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
    WHERE
    D.IdDog = 3
    AND D.SfVpGot = 2
    AND D.SfZrr = 'C';
    -- Removed columns from joined subquery from SELECT part
    SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin
    FROM DOGERR D
    LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
    T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
    WHERE
    D.IdDog = 3
    AND D.SfVpGot = 2
    AND D.SfZrr = 'C';
    NOTE: the query itself is a little stupid but this is just to demonstrate the problem. We have faced this problem at a customer with our real-world query.
    So, my question is: why different results ?
    Thanks.
    David

    hi,
    welcome to the forum,
    don't have a solution, but I thought I'd let you know that the first SQL statement only returns 1 row on 10gR2
    SQL> SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGo
    tJoin, T.SfZrr AS SfZrrJoin
      2  FROM DOGERR D
      3  LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
      4  T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
      5  WHERE
      6  D.IdDog = 3
      7  AND D.SfVpGot = 2
      8  AND D.SfZrr = 'C';
         IDDOG S      IDVPL    SFVPGOT S  IDVPLJOIN SFVPGOTJOIN S
             3 $          1          2 C
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production

  • I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query parameter to report parameter i need to pass distinct values. How can i resolve this

    I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query
    parameter to report parameter i need to pass distinct values. How can i resolve this

    Hi nancharaiah,
    If I understand correctly, you want to pass distinct values to report parameter. In Reporting Service, there are only three methods for parameter's Available Values:
    None
    Specify values
    Get values from a query
    If we utilize the third option that get values from a dataset query, then the all available values are from the returns of the dataset. So if we want to pass distinct values from a dataset, we need to make the dataset returns distinct values. The following
    sample is for your reference:
    Select distinct field_name  from table_name
    If you have any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • A In-line view query works with 8.1.6 but returns ORA-1008 with 8.1.7

    Hello Gurus,
    The following query works fine with 8.1.6 but returns
    ORA-1008: not all variables bound
    with 8.1.7.
    Here is the query:
    SELECT y.node_id , y.parent_node_id
    FROM ( SELECT x.node_id
    ,x.parent_node_id
    FROM ( SELECT a.node_id
    ,a.parent_node_id
    FROM xor_hs_base_details a
    WHERE a.node_id <>
    a.parent_node_id
    AND a.base_id=1
    ) x
    CONNECT BY PRIOR x.node_id =
    x.parent_node_id
    START WITH x.parent_node_id = 1
    ) y
    WHERE y.node_id IN ( SELECT node_id
    FROM xor_hs_transactions
    WHERE hierarchy_id = 1
    AND created_by
    = 'system'
    AND committed_on IS NULL
    Any ideas??
    TIA.
    ...Atul

    After having a closer look at metalink it seems to be obvious, that Forms 6i (8.0.6.) only supports user exits generated with the 8.0.6. precompiler.
    If this is the case new questions follow:
    Is there a way to get a 8.0.6. precompiler?
    Is it possible to connect to a 8.1.5. database with such a user exit? Does anybody have corresponding experiences?
    Our customer uses a 8.1.7. database. What about connecting to that database with the user exit?
    /Ralph

  • Infoset query with KNB1 customer's ADRC information

    Hello,
    An explanation into the problem:
    I'm trying to create an infoset query with KNA1, KNB1 and ADRC which would do the following:
    In KNA1-SORTL we hold customer numbers which can be found from KNB1. This query should:
    Display KNA1-KUNNR and relevant address data for this customer via connection KNA1-ADRNR and ADRC-ADDRNUMBER. Then it should check KNA1-SORTL- field and if it corresponds to KNB1-KUNNR, it should go back to KNA1 with this KUNNR and display all this customer's relevant address data via this customer's KNA1-ADRNR to ADRC-ADDRNUMBER.
    I'm relatively new to infoset coding and ABAP in general, plus I'm self- taught so please bear that in mind.
    I'll give an example as to what I've managed to do so far. In SQ02 I joined tables KNA1(left outer join)KNB1 and KNA1(join)ADRC and created an extra field ZADRNR to see if I could display the ADRNR for the customer number found in KNB1.
    Something along the lines of:
    IF KNB1-KUNNR = KNA1-SORTL.
    SELECT SINGLE ADDRNUMBER FROM ADRC INTO ZADRNR
    WHERE ADDRNUMBER = KNA1-ADRNR.
    ENDIF.
    Obviously this doesn't work. Pseudocode would look like this:
    Check field KNA1-SORTL
    IF KNA1-SORTL = KNB1-KUNNR THEN
    GO BACK TO KNA1 with this KUNNR and display it's ADRC.
    KNB1 sadly doesn't maintain an ADRNR of it's own, or this would be much simpler.
    Any help or advice is much appreciated, so far I've only been coding a few lines in infosets with ABAP so I'm not all that familiar with it. I've managed to create several queries through trial and error, mostly, and this forum and it's articles have helped a great deal.
    Please let me know if I should provide any additional information, and my apologies if I posted this in the wrong forum area.

    Hi Lalit, and thank you very much for your reply.
    Unfortunately excluding space entries in selection screen wouldn't solve the issue, since we have KNA1-ADRNR for each entry, it's just that it would be different for customers found in KNB1.
    I could probably solve this by making two separate queries and working on them in excel and that way we would have the necessary information.
    But in order to do this in SAP seems to mean that I have to write a custom report. For that, it seems I'll be spending New Year's eve learning how to ABAP
    Thank you for your help, at least we don't have to struggle with finding out a way to do this via queries so we'll just find alternative means for this.
    Thanks again and have a happy new year!

  • Error while trying to Execute the Query with Customer Exit

    Hi Experts,
           I am having a Query with Customer Exit, it is working fine for all the Employess, except for one. When i try to remove the Customer Exit it is working for her too. Below is the error i am getting.
    system error in program SAPLLRK0 and form RSRDR; CHECK_NAV_INIT_BACK
    Thanks,
    Kris.

    Hello Kris,
    Are you working with multiprovider? Please check if OSS notes 813454,840080 or 578948 are applicable in your case.
    Regards,
    Praveen

Maybe you are looking for

  • How to install Adobe Media Encoder C6 when CC is all ready installed

    Hello I need to be able to publish flv files, but the new Adobe Media Encoder CC can't export FLV files, therefore I need to install an older version. But I can't find it anywhere. Not on Adobe.com or en the creatiev Cloud App under previous versions

  • Trouble with ordered list & page breaks

    I'm using Framemaker 10. I was using numbering and selected Numbered Next, but FM started numbering from 1, although there were previous numbers up to 4. This has never happened before. Also in the same document, FM is sometimes forcing a page break

  • Imported PSD Files Are Being Erroneously Resized in Captivate 4

    I am trying to import PSD files to use in my Captivate 4 project. I verified that the PSD image size is 800 x 600, and my Captivate project dimensions are the same 800 x 600. But when the import process completes, the layers are erroneously resized t

  • Service Tax Standar Configuration for TAXINN

    Dear Gurus, Can anybody will provide the standar configaration document with details for Service Tax.  ( We will set-off 100% Service tax against Excise) Thanx inadvance. Regards, Venkat

  • Blocking of business area

    Hi guru One vendor(one time vendor) is created with purchasing organisation as MKTG.But users are posting to one business area (CORP) which we  WANT TO BLOCK.Actually it should be posted to MKTG business area.Now how to block that vendor for posting