Defining STDEV as an aggregate function

Is there a way to force BO XI R2 to recognize SQL function STDEV as an aggregate function?
I found a reference for version 6.5 in the following link but I can't implement the suggested solution:
http://www.forumtopics.com/busobj/viewtopic.php?p=701261&sid=8e2cfd855db2069cb84d9e021a5ba4a5
Thanks,
Paulo Gottlib

Rank syntax is
     rank( expression1, ... expression_n ) WITHIN GROUP ( ORDER BY expression1, ... expression_n )for example we are going to find employee salary and comm
select rank(1000, 500) WITHIN GROUP (ORDER BY sal, comm) from emp;The SQL statement above would return the rank of an employee with a salary of $1,000 and a commision of $500 from within the emp table.
Now we are going to find from your table like this
first of all run this query
select * from employee order by salary, JOB_IDyour result will be like this
RowNum ID JOB_ID SALARY
1     100 667 800
2     200 670 1250
3     300 670 1250
4     400 670 1600
5     500 671 2200
6     600 671 2750
7     700 671 2850----------------------------------------------------------------------------------------
select rank(2650,671) within group (order by salary, JOB_ID) from employeeit will be return value 6 because salary 2650 near to row 6 (Salary = 2750)
similarly
select rank(1900,670) within group (order by salary, JOB_ID) from employeeit will be return value 5 because salary 1900 near to row 6 (Salary = 2200)
select rank(800, 671) within group (order by salary, JOB_ID) from employee
this query return value 2 (reason is that)
salary = 800 exist on row number 1
and Job_ID = 671 exist on row_num 5 to 7due to salary and job_id both don't match so query will return those value where salary has min difference
Now check
select rank(1250, 671) within group (order by salary, JOB_ID) from employeesimilarly it will be return value 4
.... Thanks & Regards ....
--------Syed Adeel Ali-------
----------------------------------------------------------------------------------------

Similar Messages

  • How can I use User-Defined Aggregate Functions in Timesten 11? such as ODCI

    Hi
    we are using Timesten 11 version and as per the documentation, it doesn't support User-Defined Aggregate Functions.
    So we are looking for alternatives to do it. Could you please provide your expert voice on this.
    Thanks a lot.
    As the following:
    create or replace type strcat_type as object (
    cat_string varchar2(32767),
    static function ODCIAggregateInitialize(cs_ctx In Out strcat_type) return number,
    member function ODCIAggregateIterate(self In Out strcat_type,value in varchar2) return number,
    member function ODCIAggregateMerge(self In Out strcat_type,ctx2 In Out strcat_type) return number,
    member function ODCIAggregateTerminate(self In Out strcat_type,returnValue Out varchar2,flags in number) return
    number
    How can I use User-Defined Aggregate Functions in Timesten 11? such as ODCIAggregateInitialize ?

    Dear user6258915,
    You absolutely right, TimesTen doesnt support object types (http://docs.oracle.com/cd/E13085_01/doc/timesten.1121/e13076/plsqldiffs.htm) and User-Defined Aggregate Functions.
    Is it crucial for your application? Could you rewrite this functionality by using standart SQL or PL/SQL?
    Best regards,
    Gennady

  • PL/SQL : User defined Aggregate Functions ??

    Is it possible to create (using whatever language) a user defined aggregate function for transparent usage within sql ?
    e.g.
    select median(myField) from myTable
    or
    select empirical_expectation(myField) from myTable
    thanx in advance ..
    Tobias Oberstein

    HI,
    U can create a stored proc. (PL/SQL) for this and call as any other function.
    By using external procedure, U can create shared library in C or C++ and coonect this shared library by using external function/procedure. This will be become user-defined procedure.
    with regards,
    Boby Jose Thekkanath.

  • User-Defined Aggregate Function in oracle

    Somebody knows if in oracle 10g is possible to create a User-Defined Aggregate Function?
    Sometingh like my_sum, that aggregate the values in a way that i want...
    select manager, my_sum(salary)
    group by manager
    In internet i've found rellay notingh for oracle 10g...can somebody help me? Thank's in advance!

    Thank's to everybody!!! I've made my custom function sum_distinct
    create or replace type AggregateCD as object
    (  nb                   number,
         ListOfDistinctValue  clob,
        static               function ODCIAggregateInitialize(sctx IN OUT AggregateCD) return number,
        member               function ODCIAggregateIterate(self IN OUT AggregateCD, value IN VARCHAR2) return number,
         member               function ODCIAggregateTerminate(self IN AggregateCD, returnValue OUT number, flags IN number) return number,
        member               function ODCIAggregateMerge(self IN OUT AggregateCD, ctx2 IN AggregateCD) return number
    create or replace type body AggregateCD is
       static function ODCIAggregateInitialize(sctx IN OUT AggregateCD) return number is
         begin
             sctx := AggregateCD(0,null);
             return ODCIConst.Success;
        end;
        member function ODCIAggregateIterate(self IN OUT AggregateCD, value IN VARCHAR2) return number is
            ListOfValue CLOB:=self.ListOfDistinctValue ;
         begin
             self.nb:=self.nb+to_number(substr(value , INSTR(value, ';', 1, 1)+1 ,length(value)));
            return ODCIConst.Success;
        end;
        member function ODCIAggregateTerminate(self IN AggregateCD, returnValue OUT number, flags IN number) return number is
         begin
              returnValue := self.nb;
              return ODCIConst.Success;
        end;
         member function ODCIAggregateMerge(self IN OUT AggregateCD, ctx2 IN AggregateCD) return number is
         begin
             self.nb := ctx2.nb;
             return ODCIConst.Success;
        end;
      end;
    CREATE OR REPLACE FUNCTION sum_distinct (input VARCHAR2) RETURN number
      PARALLEL_ENABLE AGGREGATE USING AggregateCD;you can use so:
    select sum_distinct(distinct t.primary_key||';'||t.import)
    from table1 t, table2_with_bad_join
    it's the same of
    select sum(t.import)
    from table 1

  • 8i personal : error when Create user defined aggregate function

    Hi,
    I have problem on creating user defined aggregate function.
    I try to create the sample aggregate function "SecondMax" from 9i developer guide(append at the end of this post).
    It's work to create object type and the type body, but
    there is error when I create the aggregate function..
    "CREATE FUNCTION SecondMax (input NUMBER) RETURN NUMBER
    PARALLEL_ENABLE AGGREGATE USING SecondMaxImpl;"
    I am using 8i personal now.. is that the syntax of create function in 9i is different from that in 8i?
    Example: Creating and Using a User-Defined Aggregate
    This example illustrates creating a simple user-defined aggregate function SecondMax() that returns the second-largest value in a set of numbers.
    Creating SecondMax()
    Implement the type SecondMaxImpl to contain the ODCIAggregate routines.
    create type SecondMaxImpl as object
    max NUMBER, -- highest value seen so far
    secmax NUMBER, -- second highest value seen so far
    static function ODCIAggregateInitialize(sctx IN OUT SecondMaxImpl)
    return number,
    member function ODCIAggregateIterate(self IN OUT SecondMaxImpl,
    value IN number) return number,
    member function ODCIAggregateTerminate(self IN SecondMaxImpl,
    returnValue OUT number, flags IN number) return number,
    member function ODCIAggregateMerge(self IN OUT SecondMaxImpl,
    ctx2 IN SecondMaxImpl) return number
    Implement the type body for SecondMaxImpl.
    create or replace type body SecondMaxImpl is
    static function ODCIAggregateInitialize(sctx IN OUT SecondMaxImpl)
    return number is
    begin
    sctx := SecondMaxImpl(0, 0);
    return ODCIConst.Success;
    end;
    member function ODCIAggregateIterate(self IN OUT SecondMaxImpl, value IN number)
    return number is
    begin
    if value > self.max then
    self.secmax := self.max;
    self.max := value;
    elsif value > self.secmax then
    self.secmax := value;
    end if;
    return ODCIConst.Success;
    end;
    member function ODCIAggregateTerminate(self IN SecondMaxImpl, returnValue OUT
    number, flags IN number) return number is
    begin
    returnValue := self.secmax;
    return ODCIConst.Success;
    end;
    member function ODCIAggregateMerge(self IN OUT SecondMaxImpl, ctx2 IN
    SecondMaxImpl) return number is
    begin
    if ctx2.max > self.max then
    if ctx2.secmax > self.secmax then
    self.secmax := ctx2.secmax;
    else
    self.secmax := self.max;
    end if;
    self.max := ctx2.max;
    elsif ctx2.max > self.secmax then
    self.secmax := ctx2.max;
    end if;
    return ODCIConst.Success;
    end;
    end;
    Create the user-defined aggregate.
    CREATE FUNCTION SecondMax (input NUMBER) RETURN NUMBER
    PARALLEL_ENABLE AGGREGATE USING SecondMaxImpl;
    Using SecondMax()
    SELECT SecondMax(salary), department_id
    FROM employees
    GROUP BY department_id
    HAVING SecondMax(salary) > 9000;

    This could be a x64/x86 problem. Try following this thread
    [GetCompanyService|GetCompanyService] and recompile your code for the platform you need.

  • Lookiing for example of a user define aggregate function in Java

    I want to write an aggregate function in Java. Every example I found is in PL/SQL.
    I have written my fair share of JSPs, but this is different in that it is methods off an object.
    The documentation says it can be done in Java, but it's not clear to me how to define the ODCIAggregateInitialize, ODCIAggregateIterate, ODCIAggregateTerminate, and ODCIAggregateMerge methods.
    If any one can point me to, or send me, an example, I would be very grateful.
    TIA

    Hii Greg:
    You can find the code to implement a Domain Index for Oracle which uses ODCI Api in Java at.
    http://dbprism.cvs.sourceforge.net/viewvc/dbprism/ojvm/src/java/org/apache/lucene/indexer/LuceneDomainIndex.java?revision=1.29&view=markup
    This is the code of the implementation of the Lucene Domain Index:
    http://docs.google.com/Doc?id=ddgw7sjp_54fgj9kg
    The strategy to implement an use aggregate function is similar to implement a Domain Index.
    The PLSQL wrapper for the above code is:
    http://dbprism.cvs.sourceforge.net/viewvc/dbprism/ojvm/db/LuceneDomainIndex.sql?revision=1.20&view=markup
    Take a look at the code and if you have another question just drop me an email or post again into this list.
    Best regards, Marcelo.

  • Facing problem while using aggregate functions.

    I am trying to use aggregate functions such as sum, count in my CQL query.
    It is not giving me an error but i am unable to get the correct output out of that.
    Query is:
    <?xml version="1.0" encoding="UTF-8"?>
    <wlevs:config xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
    xmlns:jdbc="http://www.oracle.com/ns/ocep/config/jdbc">
    <processor>
    <name>APL_EFW_CostEvent_Processor</name>
    <rules>
         <view id="CostEventView"
              schema="eventName eventType eventId opportunityStatusId opportunity_cost APL_Event_Inbound"><![CDATA[
                   SELECT      X.eventName, X.eventType,
                        X.eventId, X.opportunityStatusId,
                        X.opportunity_cost,X.APL_Event_Inbound
                        from APL_EFW_Master_Inbound_Channel
                        XMLTable (
                             '/' PASSING BY VALUE APL_EFW_Master_Inbound_Channel.APL_Event_Inbound as "."
                        COLUMNS
                             eventId char(256) PATH 'fn:data(Event/EventHeader/eventId)',
                             eventName char(256) PATH 'fn:data(Event/EventHeader/eventName)',
                             eventType char(256) PATH 'fn:data(Event/EventHeader/eventType)',
                                  opportunityStatusId char(256) PATH                               'fn:data(Event/ApplicationDataArea/opportunity/opportunity_details/opportunity_status)',
                                  opportunity_cost char(256) PATH                               'fn:data(Event/ApplicationDataArea/opportunity/opportunity_details/opportunity_cost)',
                                  APL_Event_Inbound xmltype path '/'
                        ) AS X
                   ]>
         </view>
    <query id="CostEventQuery">
              <![CDATA[
                   SELECT
                        XMLELEMENT("opportunity",
                             XMLELEMENT("cost_opportunity",
                                  XMLFOREST(X.opportunity_cost))) as APL_Event_Inbound
                             FROM CostEventView
                             MATCH_RECOGNIZE (
                             MEASURES
                                  A.opportunity_cost as opportunity_cost
                                  PATTERN (B A+) within 30000 milliseconds
                                  DEFINE
                                  A as sum(A.opportunity_cost)> 1000                    )
                        as X
              ]]>
              </query>
    </rules>
    </processor>
    </wlevs:config>
    The problem i am getting is when the value is getting compared with the opportunity cost rather than with the sum of oppCost
    A as sum(A.opportunityCost)>1000
    A as A.opportunityCost >1000
    Both the cases are treated as same .

    It would help if you could provide sample input data and associated output that illustrates the problem

  • Aggregate function using DB adapter

    Is it possible to use aggrgeate functions like count and things like ROWNUM using the DBAdapter wizard in BPEL 10.1.2 ?
    For Example how can I configure a query like
    Select * from emp where ROWNUM<500

    hi all,
    i think there is no way to define external functions like ROWNUM and all in bpel 10.1.2 as we can not write manual sql query in expression block and expression builder don't have aggregate functions .
    But, in 10.1.3 we can write any sql query in expression and it is working fine.
    Is it a bug in 10.1.2?

  • How to Perform an Aggregate Function?

    Hi,
    I'm trying to define in Designer 6.5 an object with the following select: (example)
    sum (count (distinct REPORTING.table.object_name))
    the SQL parsing restitues me this error --> "The SQL can not perform an aggregate function on an expression containing an aggregate or a subquery".
    Can anyboby explain me the problem and above all how to solve it?
    Thanks
    Riccardo

    Hi,
    You cannot mix different aggregations functions in the same SQL expression: this is a SQL limitation for all databases.
    You need to use subselect to achieve your requirement.
    See the following example that works on SQL Server:
    Select sum(a._count) from
    (Select count (distinct cust_id) as _count from Club.dbo.Customer) a
    Regards,
    Didier

  • What does AverageOfChildren aggregate function in SSAS 2005 actually do?

    Folks,
    Have any of you been playing around with SSAS 2005 to have worked out
    what the AverageOfChildren aggregate function actually does?
    I was expecting it to do the equivalent of a simple AVG() with a GROUP
    BY in SQL, but it seems to be doing something additional to that.
    No-one in the team I work in has been able to work out what exactly it
    is doing.
    Any info would be appreciated!
    Cheers,
    Kenneth

    This very question was recently discussed in the public SQL Server OLAP newsgroup:
    http://groups.google.com/group/microsoft.public.sqlserver.olap/msg/c662e201b99678bc
    >>
     Aggregate Function Average of Children does not work
    This behavior could occur because
    AverageOfChildren,FirstChild,LastChild,FirstNonEmpty and LastNonEmpty are
    semi-additive and treats the Time dimension different from the other
    dimensions. Please refer to the following link for details:
    http://msdn2.microsoft.com/en-us/library/ms175356.aspx
    The description in above link (BOL) is not very clear about
    AverageOfChildren, and I have forward this feedback to the proper channel.
    The AverageOfChildren only applys when aggregating via Time dimension.  
    Actually, when you try to create a new measure in cube, when you select
    usage, you could see "average over time" which is for AverageOfChildren.
    To get the result of average behavior you want, you may want define a Sum
    and a Count measure, then create a calculated measure (in the cube script)
    which divides the two base measures.
    >>

  • New aggregate function in IR

    Hi all,
    Can we create a new aggregate function in IR instead of using predefined functions? I need to show percentage below each column based on my function returning percentage value. Is there any way to do it?
    Thanks
    Sunil Bhatia

    Hi,
    no. You cannot define new aggregate functions in IR which can be used like the predefined ones.
    But you can use aggregate functions within your select statement.
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at and http://www.wirsindapex.at

  • Analytic function and aggregate function

    What are analytic function and aggregate function. What is difference between them?

    hi,
    Analytic Functions :----------
    Analytic functions compute an aggregate value based on a group of rows. They differ from aggregate functions in that they return multiple rows for each group. The group of rows is called a window and is defined by the analytic_clause. For each row, a sliding window of rows is defined. The window determines the range of rows used to perform the calculations for the current row. Window sizes can be based on either a physical number of rows or a logical interval such as time.
    Analytic functions are the last set of operations performed in a query except for the final ORDER BY clause. All joins and all WHERE, GROUP BY, and HAVING clauses are completed before the analytic functions are processed. Therefore, analytic functions can appear only in the select list or ORDER BY clause.
    Analytic functions are commonly used to compute cumulative, moving, centered, and reporting aggregates.
    Aggregate Functions :----------
    Aggregate functions return a single result row based on groups of rows, rather than on single rows. Aggregate functions can appear in select lists and in ORDER BY and HAVING clauses. They are commonly used with the GROUP BY clause in a SELECT statement, where Oracle Database divides the rows of a queried table or view into groups. In a query containing a GROUP BY clause, the elements of the select list can be aggregate functions, GROUP BY expressions, constants, or expressions involving one of these. Oracle applies the aggregate functions to each group of rows and returns a single result row for each group.
    If you omit the GROUP BY clause, then Oracle applies aggregate functions in the select list to all the rows in the queried table or view. You use aggregate functions in the HAVING clause to eliminate groups from the output based on the results of the aggregate functions, rather than on the values of the individual rows of the queried table or view.
    let me know if you are feeling any problem in understanding.
    thanks.
    Edited by: varun4dba on Jan 27, 2011 3:32 PM

  • Problem with my aggregate function

    Hello there,
    I tried to build my own string aggregate function but I've a troubles when I'm using it into my query. When I'm using it, it writes ORA904, whereas this idenfifier exists. Do you know what's wrong ?
    here my aggregate function :
    create or replace FUNCTION aggme (query_in in VARCHAR2) RETURN VARCHAR2 IS
        incoming    varchar2(4000);
        hold_result varchar2(4000);
        c sys_refcursor;
    Begin
        open c for query_in;
        loop
            fetch c into incoming;
            exit when c%notfound;
            hold_result := hold_result||','||incoming;
        end loop;
        return ltrim(hold_result,',');
    END;and here my query by using my aggregate function aggme:
    select
      RES.LASTNAME as "LASTNAME",
      RES.FIRSTNAME as "FIRSTNAME",
      aggme('select NAME from PATHOLOGY where ID= RES.PATHOLOGY_ID') as "PATHOLOGY"
    from
      TBK_RESOURCE RES

    Mustafa KALAYCI wrote:
    I think you wanted to do this:
    select
    RES.LASTNAME as "LASTNAME",
    RES.FIRSTNAME as "FIRSTNAME",
    aggme('select NAME from PATHOLOGY where ID=' || RES.PATHOLOGY_ID) as "PATHOLOGY"
    from
    TBK_RESOURCE RESby the way this is a very very bad idea doing like that. you should look for WM_CONCAT (for db version 11.1 or lower)No. Nobody should use WM_CONCAT. It's an undocumented function that is not supported by Oracle and may be changed in future versions without notice.
    All Oracle experts say not to use it, including Tom Kyte... Re: DISTINCT not working with  wmsys.wm_concat
    Below 11gR2, you should use SYS_CONNECT_BY_PATH, or a user defined function, including user defined aggregate functions such as the following example, which aggregates strings into a clob as a result...
    create or replace type clobagg_type as object
      text clob,
      static function ODCIAggregateInitialize(sctx in out clobagg_type) return number,
      member function ODCIAggregateIterate(self in out clobagg_type, value in clob) return number,
      member function ODCIAggregateTerminate(self in clobagg_type, returnvalue out clob, flags in number) return number,
      member function ODCIAggregateMerge(self in out clobagg_type, ctx2 in clobagg_type) return number
    create or replace type body clobagg_type is
      static function ODCIAggregateInitialize(sctx in out clobagg_type) return number is
      begin
        sctx := clobagg_type(null) ;
        return ODCIConst.Success ;
      end;
      member function ODCIAggregateIterate(self in out clobagg_type, value in clob) return number is
      begin
        self.text := self.text || value ;
        return ODCIConst.Success;
      end;
      member function ODCIAggregateTerminate(self in clobagg_type, returnvalue out clob, flags in number) return number is
      begin
        returnValue := self.text;
        return ODCIConst.Success;
      end;
      member function ODCIAggregateMerge(self in out clobagg_type, ctx2 in clobagg_type) return number is
      begin
        self.text := self.text || ctx2.text;
        return ODCIConst.Success;
      end;
    end;
    create or replace function clobagg(input clob) return clob
      deterministic
      parallel_enable
      aggregate using clobagg_type;
    SQL> select trim(',' from clobagg(ename||',')) as enames from emp;
    ENAMES
    SMITH,ALLEN,WARD,JONES,MARTIN,BLAKE,CLARK,SCOTT,KING,TURNER,ADAMS,JAMES,FORD,MILLER
    SQL> ed
    Wrote file afiedt.buf
      1  with t as
      2    (select 'PFL' c1, 0 c2,110 c3 from dual union all
      3     select 'LHL', 0 ,111 from dual union all
      4     select 'PHL', 1, 111 from dual union all
      5     select 'CHL', 2, 111 from dual union all
      6     select 'DHL', 0, 112 from dual union all
      7     select 'VHL', 1, 112 from dual union all
      8     select 'CPHL', 0, 114 from dual union all
      9     select 'WDCL', 1, 114 from dual union all
    10     select 'AHL' ,2 ,114 from dual union all
    11     select 'NFDL', 3, 114 from dual)
    12  --
    13  -- end of test data
    14  --
    15  select trim(clobagg(c1||' ')) as c1, c3
    16  from (select * from t order by c3, c2)
    17  group by c3
    18* order by c3
    SQL> /
    C1                                     C3
    PFL                                   110
    LHL CHL PHL                           111
    DHL VHL                               112
    CPHL AHL NFDL WDCL                    114

  • Trying to create a Histogram type/object for aggregate functions

    Hi,
    I am trying to create an aggregate function that will return a histogram
    type.
    It doesn't have to be an object that is returned, I don't mind returning
    a string but I would like to keep the associative array (or something
    else indexed by varchar2) as a static variable between iterations.
    I started out with the SecondMax example in
    http://www.csis.gvsu.edu/GeneralInfo/Oracle/appdev.920/a96595/dci11agg.htm#1004821
    But even seems that even a simpler aggregate function like one strCat
    below (which works) has problems because I get multiple permutations for
    every combination. The natural way to solve this would be to create an
    associative array as a static variable as part of the Histogram (see
    code below). However, apparently Oracle refuses to accept associate
    arrays in this context (PLS-00355 use of pl/sql table not allowed in
    this context).
    If there is no easy way to do the histogram quickly can we at least get
    something like strCat to work in a specific order with a "partition by
    ... order by clause"? It seems that even with "PARALLEL_ENABLE"
    commented out strCat still calls merge for function calls like:
    select hr,qtr, count(tzrwy) rwys,
    noam.strCat(cnt) rwycnt,
    noam.strCat(tzrwy) config,
    sum(cnt) cnt, min(minscore) minscore, max(maxscore) maxscore from
    ordrwys group by hr,qtr
    Not only does this create duplicate entries in the query result like
    "A,B,C" and "A,C,B" it seems that the order in rwycnt and config are not
    always the same so a user can not match the results based on their
    order.
    The difference between my functions and functions like sum and the
    secondMax demonstrated in the documentation is that secondMax does not
    care about the order in which it gets its arguments and does not need to
    maintain an ordered set in order to return the correct results. A good
    example of a built in oracle function that does care about all its
    arguments and probably has to maintain a similar data structure to the
    one I want is the PERCTILE_DISC function. If you can find the code for
    that function (or something like it) and forward a reference to me that
    in itself would be very helpful.
    Thanks,
    K.Dingle
    CREATE OR REPLACE type Histogram as object
    -- TYPE Hist10 IS TABLE OF pls_integer INDEX BY varchar2(10),
    -- retval hist10;
    -- retval number,
    retval noam.const.hist10,
    static function ODCIAggregateInitialize (sctx IN OUT Histogram)
    return number,
    member function ODCIAggregateIterate (self IN OUT Histogram,
    value IN varchar2) return number,
    member function ODCIAggregateTerminate (self IN Histogram,
    returnValue OUT varchar2,
    flags IN number) return number,
    member function ODCIAggregateMerge (self IN OUT Histogram,
    ctx2 IN Histogram) return number
    CREATE OR REPLACE type body Histogram is
    static function ODCIAggregateInitialize(sctx IN OUT Histogram) return
    number is
    begin
    sctx := const.Hist10();
    return ODCIConst.Success;
    end;
    member function ODCIAggregateIterate(self IN OUT Histogram, value IN
    varchar2)
    return number is
    begin
    if self.retval.exist(value)
    then self.retval(value):=self.retval(value)+1;
    else self.retval(value):=1;
    end if;
    return ODCIConst.Success;
    end;
    member function ODCIAggregateTerminate(self IN Histogram,
    returnValue OUT varchar2,
    flags IN number)
    return number is
    begin
    returnValue := self.retval;
    return ODCIConst.Success;
    end;
    member function ODCIAggregateMerge(self IN OUT Histogram,
    ctx2 IN Histogram) return number is
    begin
    i := ctx2.FIRST; -- get subscript of first element
    WHILE i IS NOT NULL LOOP
    if self.retval.exist(ctx2(i))
    then self.retval(i):=self.retval(i)+ctx2.retval(i);
    else self.retval(value):=ctx2.retval(i);
    end if;
    i := ctx2.NEXT(i); -- get subscript of next element
    END LOOP;
    return ODCIConst.Success;
    end;
    end;
    CREATE OR REPLACE type stringCat as object
    retval varchar2(16383), -- concat of all value to now varchar2, --
    highest value seen so far
    static function ODCIAggregateInitialize (sctx IN OUT stringCat)
    return number,
    member function ODCIAggregateIterate (self IN OUT stringCat,
    value IN varchar2) return number,
    member function ODCIAggregateTerminate (self IN stringCat,
    returnValue OUT varchar2,
    flags IN number) return number,
    member function ODCIAggregateMerge (self IN OUT stringCat,
    ctx2 IN stringCat) return number
    CREATE OR REPLACE type body stringCat is
    static function ODCIAggregateInitialize(sctx IN OUT stringCat) return
    number is
    begin
    sctx := stringCat('');
    return ODCIConst.Success;
    end;
    member function ODCIAggregateIterate(self IN OUT stringCat, value IN
    varchar2)
    return number is
    begin
    if self.retval is null
    then self.retval:=value;
    else self.retval:=self.retval || ',' || value;
    end if;
    return ODCIConst.Success;
    end;
    member function ODCIAggregateTerminate(self IN stringCat,
    returnValue OUT varchar2,
    flags IN number)
    return number is
    begin
    returnValue := self.retval;
    return ODCIConst.Success;
    end;
    member function ODCIAggregateMerge(self IN OUT stringCat,
    ctx2 IN stringCat) return number is
    begin
    self.retval := self.retval || ctx2.retval;
    return ODCIConst.Success;
    end;
    end;
    CREATE OR REPLACE FUNCTION StrCat (input varchar2) RETURN varchar2
    -- PARALLEL_ENABLE
    AGGREGATE USING StringCat;

    GraphicsConfiguration is an abstract class. You would need to subclass it. From the line of code you posted, it seems like you are going about things the wrong way. What are you trying to accomplish? Shouldn't this question be posted in the Swing or AWT forum?

  • Error in using aggregate function in Outer Query in Siebel Analytics

    Hi,
    When I am using aggregate function in outer query in Siebel Analytics I am facing error.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 59111] The SQL statement must include a GROUP BY clause. (HY000)
    Bellow is the code.
    SELECT test1.username saw_0, test1.desg saw_1,COUNT (test2.querydate) saw_2
    FROM (SELECT POSITION.CBL username,
    POSITION.CBP desg
    FROM "CM"
    WHERE (POSITION.BPTCD = 'Marketing')
    AND (POSITION.EDate =TIMESTAMP '1899-01-01 00:00:00'
    ) test1,
    (SELECT users.UN username,
    measures."Query Count" querycount,
    measures."Max Total Time" secs,
    topic.db dashboardname,
    "Query Time".DATE querydate
    FROM "Plan"
    WHERE (topic."Dashboard Name" IN ('DS'))) test2
    WHERE test2.username = LOWER (test1.username)
    AND test2.dashboardname = 'DS'
    GROUP BY test1.username, test1.desg

    Should your query be a valid SQL query?
    I can't think that the query you have would be valid in a SQL plus window.
    Chris

Maybe you are looking for

  • How to undo a batch change of all titles in iPhoto

    I accidentally secected all of my photos thinking I was in an album and batch changed all 30,000 photos titles to the same tilte. I had to forse quit due to the unstopable spinning ball. I'm about to cry but hope someone can help me... Mr. Old Toad??

  • Itunes causing desktop crash/restart

    Just did a sizable Java and iTunes update to 10.7 (21) a little earlier today. For some reason, the finder keeps crashing or restarting every 30 seconds or so. Its not a big issue, it's just really annoying.

  • Trasport request target system

    hi all . Is there any possibility to know the target system of trasport request ? . I am able to get the detail through table E070 and E071 . but it showing only one target system . But request trasferred to more than one system . i.e to say quality

  • Upgrade to ECC 6.0 EHP3 EA-HR 603

    Hello, can anyone out there help us. We currently have R/3 Enterprise 4.7 Extension set 2.0 and have the following HR based components activated: EA-HR and EA-TRV as we are live with Travel Management and PCP. We are upgrading too ERP2005 (ECC 6.0) w

  • Upgrade from Tiger (client) to Leopard Server

    Hi all, I have a client with an existing dual G5 box they have running Tiger. They use it as a file share primarily but want the extra functionality of the server OS (viz Leopard server). Is there an upgrade path from OS 10.4 client to 10.5 server or