Problem using DECODE() function with a Query of Queries

I
posted
on my blog about an issue I was having trying to use the PL/SQL
DECODE() function with a Coldfusion Query of Queries. This function
works fine when you query a database for information. However, when
you query another query, it seems that CF doesn't recognize it. I
got errors stating that it found a left parenthesis where it
expected a FROM key word. Here is a simplified version of what I am
trying to do:
quote:
<!--- Simulated query; similar to what I was calling from
my database --->
<cfscript>
qOriginal = queryNew("Name,Email,CountryCode",
"VarChar,VarChar,VarChar");
newRow = queryAddRow(qOriginal, 5);
querySetCell(qOriginal, "Name", "Joe", 1);
querySetCell(qOriginal, "Email", "[email protected]", 1);
querySetCell(qOriginal, "CountryCode", "AMER", 1);
querySetCell(qOriginal, "Name", "Sally", 2);
querySetCell(qOriginal, "Email", "[email protected]", 2);
querySetCell(qOriginal, "CountryCode", "AMER", 2);
querySetCell(qOriginal, "Name", "Bob", 3);
querySetCell(qOriginal, "Email", "[email protected]", 3);
querySetCell(qOriginal, "CountryCode", "ASIA", 3);
querySetCell(qOriginal, "Name", "Mary", 4);
querySetCell(qOriginal, "Email", "[email protected]", 4);
querySetCell(qOriginal, "CountryCode", "EURO", 4);
querySetCell(qOriginal, "Name", "John", 5);
querySetCell(qOriginal, "Email", "[email protected]", 5);
querySetCell(qOriginal, "CountryCode", "EURO", 5);
</cfscript>
<cfquery name="qCountries" dbtype="query">
SELECT DISTINCT(CountryCode) AS CountryCode,
DECODE(states, "AMER", "North America &amp; Canada",
"EURO", "Europe &amp; Africa", "ASIA", "Japan &amp;
Asia","") CountryName
FROM qOriginal
ORDER BY CountryCode
</cfquery>
<cfdump var="#qCountries#">
<!--- ========== END OF CODE ========== --->
So running this returned the following error:
Query Of Queries syntax error.
Encountered "(. Incorrect Select Statement, Expecting a
'FROM', but encountered '(' instead, A select statement should have
a 'FROM' construct.
Does anybody know why this doesn't work? Is it just not
supported? Please note that I have also tried to use the CASE()
function instead of DECODE() and that resulted in basically the
same error. For now I an looping over my distinct query with a
switch statement and manually loading a new query with the data how
I want it. But it would be a lot cleaner and less code to have the
DECODE() to work. Thx!

DECODE() is an Oracle function, not generic SQL. Q-of-Q is a
very limited subset of SQL and lacks many functions and clauses
available in standard SQL, especially what you may be used to using
in your particular RDBMS.
See
Query
of Queries user guide
Phil

Similar Messages

  • Problem using DECODE function

    I'm trying to decode the following, but I seem to be having a syntax issue:
    decode
           p.balls,p.strikes,
           1,0 '1-0 Count',
           2,0 '2-0 Count',
           3,0 '3-0 Count',
           0,1 '0-1 Count',
           0,2 '0-2 Count',
           1,1 '1-1 Count',
           2,1 '2-1 Count',
           3,1 '3-1 Count',
           0,2 '0-2 Count',
           1,2 '1-2 Count',
           2,2 '2-2 Count',
    ) as Count,what I'm trying to have happen is anytime the balls column has a '1' and the strike column has a '0' to decode to '1-0 Count' etc...

    Decode compares the value of the first paramter with the values of the even parameters and returns the following odd parameters value when the first match is found. If the last parameter is an even numbered parameter it is taken as the default when no other matches are found.
    So your code compares p.balls to p.strikes and if they match returns a 1 then it runs into a syntax error since you don't have any commas after the forth column.
    If you want to perform a multicolumn compare in the manner you are showing you will need to use a CASE statement instead:
    case when (p.balls, p.strikes) in ( (1, 0) ) then '1-0 Count'
         when (p.balls, p.strikes) in ( (2, 0) ) then '2-0 Count'
         when (p.balls, p.strikes) in ( (3, 0) ) then '3-0 Count'
         when (p.balls, p.strikes) in ( (0, 1) ) then '0-1 Count'
         when (p.balls, p.strikes) in ( (0, 2) ) then '0-2 Count'
    end as "COUNT"

  • How to use decode function

    Hello Friends,
    I have a query that has different columns and I am not sure what the data type of each column is ...
    I want to use decode function which displays the following if the value of the column is like this ..
    if the value of column is -714E ie -700000000000000 then display as .A
    if the value of column is -814E ie -800000000000000 then display as .B
    NOTE ; don't know which column is having the value - and i don't know the data type of the column is ..
    got to use the decode function for all the columns selected ..
    I want to use decode function pls let me know how to write for this kind of requirement.
    appreciate your help in this rgds.
    thanks/kumar

    Dear Sir / Madam,
    Thanks for your understanding.
    Right now I am facing a unique problem.
    I am using decode function in a select statement. The columns are dynamic some columns are of type number and some are varchar datatypes. I want to apply decode function for every column irrespective of datatype.
    What i am finding difficult is if the column is a number datatype , the decode funciton is working good but if the column datatype is varchar or char datatype then i am getting ..
    here's the decode function..
    decode (CHAI.EVNDRIVE,
    -800000000000000,'.A',
    -700000000000000, '.B',
    -600000000000000 ,'.C',
    -500000000000000 , '.D',
    -400000000000000 , '.E',
    -300000000000000 , '.F',
    -200000000000000, '.G',
    -100000000000000 , '.H',
    -1000000000, '.R' ,CHAI.EVNDRIVE ) EVNDRIVE
    report error:
    ORA-01722: invalid number
    pls let me know how to over come this kind of scenario.
    is their a way to find whether the column datatype is number or char , so that i can check the column datatype before the decode funciton is applied ..
    thanks ..
    kumar

  • Problem using LIKE function

    Hi Guyz,
    I am having small problem using LIKE function . The problem is I am using LIKE function in the WHERE clause
    to compare a column to a particular value, which gets this value from the front end. If the user has a single quote in the string he entered then the LIKE function is not working because of the single quote. Is there any way I can escape the single quote like we escape '%' and '_'.
    Thankyou.

    Mod_plsql supports bind variables, as do almost all front-end tools that deal with Oracle (and most other databases). I do not code mod pl/sql myself, but others here do, and I see bind variables in their code all the time (if I don't, they hear from me :-)).
    If you pass a bind variable, the quote problem goes away. As far as I know (which is not very far), you should be able to take the string with the quote directly from your input field, bind it to the variable in your query and have no problems.
    I suspect that the reson you are having issues is that you are just gluing strings together to create a sql statement. this is the wrong approach.
    The java term for what you are looking for is prepared statement, I'm not sure what the equivalent is i mod plsql, but that should give you a start.
    John

  • How to use DECODE function in Exspression?

    Hi,
    Can we use DECODE in Expression?
    I'm trying to use DECODE function but there is an error during the validation. But when i validate the mapping, it is successfully compiled but it is failed during deployment.
    But if I use CASE instead of DECODE, it works fine.
    Can we use DECODE in OWB???
    Thanks
    Raj

    Hi,
    In OWB 10gR2, if your are using only one DECODE in an expression, it's working. The package will compile when deploying the mapping. OWB will replace the DECODE by a CASE.
    But when you are using nested decode in an expression ( for example : decode(col1, 1, 'M', decode(col2, 'Madame', 'Mme', null)) ) only the first one is replaced by a case at deployment.
    In ROW_BASED mode, text of the expression is used outside of an sql statement and deployment will fails with "PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL statement only."
    If operating mode for the mapping is set to SET_BASED, it's working because the expression is used in an sql statement.
    I have logged a SR in metalink for this issue and a bug is opened (bug 5414112).
    But I agree with you, it's better to use case statement.
    Bernard

  • Problem using two function based indexes at once!

    Hello Oracle!
    I've got problems using two function based indexes on geometries at once.
    The problem occures, when I use a spatial join between two geometries both using function based indexes.
    The test case:
    CREATE TABLE quad (centroid NUMBER);
    CREATE TABLE points (no NUMBER, point MDSYS.SDO_GEOMETRY);
    CREATE OR REPLACE FUNCTION getQuad (centroid NUMBER) RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC IS
    BEGIN
    RETURN MDSYS.SDO_GEOMETRY(2003, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(centroid-5,centroid-5,centroid+5,centroid-5,centroid+5,centroid+5,centroid-5,centroid+5,centroid-5,centroid-5));
    END;
    INSERT INTO USER_SDO_GEOM_METADATA VALUES('quad','tiedge.getQuad(centroid)',MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X', -100, 100, .0000001), MDSYS.SDO_DIM_ELEMENT('Y', -100, 100, .0000001)),NULL);
    CREATE INDEX quad_idx on quad(getQuad(centroid)) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    INSERT INTO quad VALUES (0);
    INSERT INTO quad VALUES (5);
    INSERT INTO quad VALUES (10);
    INSERT INTO points VALUES (1, MDSYS.SDO_GEOMETRY(1001,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1),MDSYS.SDO_ORDINATE_ARRAY(4,4)));
    ALTER SESSION SET QUERY_REWRITE_INTEGRITY=TRUSTED;
    ALTER SESSION SET QUERY_REWRITE_ENA[i]Long postings are being truncated to ~1 kB at this time.

    hi there,
    For a better audience for this question, I'd look at the database forum.
    guys on that will be a lot more familiar with FBIs
    thanks
    Barry

  • How can I use AGO function with aggregates

    I use aggregated table and a detailed table
    I have time hierarchy whose lowest level is date. For sales I
    created year-to-year (YTD) comparision with AGO function. It
    works OK.
    BUT, I want to speed it up, so I used aggregates. I created new
    time table grouped by MONTH and corresponding agg_SALES table. I
    created connections and mapped the fields. It works OK for
    normal queries, that means my queries at month level use
    aggregates. BUT when I add YTD measures or YAGO measure in query, it goes to
    then SALES table whose grain is date.
    How can I force BI Server to use AGO function with aggregates?
    I use OBIEE 10.1.3.4
    Thank you
    Ishaq
    (Question originally taken from ITtoolbox and posted by Gorazd)
    SORRY - THE QUESTION IS IN THE WRONG FORUM
    Edited by: ishaq12 on Nov 19, 2008 12:21 PM

    Hi,
    you can not do it in Administration tool but you can set agregation for that field in Answers (fx->Agregation rule->Sum) and effect should be the same. Note that it may not work properly on Oracle 10g as generated SQL is not 100% recognized, on 11g everything is OK (at least in my case).
    Regards,
    Marko
    Edited by: user10449532 on 2008.11.19 06:29

  • Problem using CORBA clients with RMI/EJB servers..!!!???

    Hi,
    I have a question on using EJB / or RMI servers with CORBA clients using
    RMI-IIOP transport, which in theory should work, but in practice has few
    glitches.
    Basically, I have implemented a very simple server, StockTreader, which
    looks up for a symbol and returns a 'Stock' object. In the first example, I
    simplified the 'Stock' object to be a mere java.lang.String, so that lookup
    would simply return the 'synbol'.
    Then I have implemented the above, as an RMI-IIOP server (case 1) and a
    CORBA server (case 2) with respective clients, and the pair of
    client-servers work fine as long as they are CORBA-to-CORBA and RMI-to-RMI.
    But the problem arises when I tried using the RMI server (via IIOP) with the
    CORBA client, when the client tries to narrow the object ref obtained from
    the naming service into the CORBA idl defined type (StockTrader) it ends up
    with a class cast exception.
    This is what I did to achieve the above results:
    [1] Define an RMI interface StockTrader.java (extending java.rmi.Remote)
    with the method,
    public String lookup( String symbol) throws RMIException;
    [2] Implement the StorckTrader interface (on a PortableRemoteObject derived
    class, to make it IIOP compliant), and then the server to register the stock
    trader with COS Naming service as follows:
    String homeName =....
    StockTraderImpl trader =new StockTraderImpl();
    System.out.println("binding obj <" homeName ">...");
    java.util.Hashtable ht =new java.util.Hashtable();
    ht.put("java.naming.factory.initial", args[2]);
    ht.put("java.naming.provider.url", args[3]);
    Context ctx =new InitialContext(ht);
    ctx.rebind(homeName, trader);
    [3] Generate the RMI-IIOP skeletons for the Implementation class,
    rmic -iiop stock.StockTraderImpl
    [4] generate the IDL for the RMI interface,
    rmic -idl stock.StockTraderImpl
    [5] Generate IDL stubs for the CORBA client,
    idlj -v -fclient -emitAll StockTraderImpl.idl
    [6] Write the client to use the IDL-defined stock trader,
    String serverName =args[0];
    String symList =args[1];
    StockClient client =new StockClient();
    System.out.println("init orb...");
    ORB orb =ORB.init(args, null);
    System.out.println("resolve init name service...");
    org.omg.CORBA.Object objRef
    =orb.resolve_initial_references("NameService");
    NamingContext naming =NamingContextHelper.narrow(objRef);
    ... define a naming component etc...
    org.omg.CORBA.Object obj =naming.resolve(...);
    System.out.println("narrow objRef: " obj.getClass() ": " +obj);
    StockTrader trader =StockTraderHelper.narrow(obj);
    [7] Compile all the classes using Java 1.2.2
    [8] start tnameserv (naming service), then the server to register the RMI
    server obj
    [9] Run the CORBA client, passing it the COSNaming service ref name (with
    which the server obj is registered)
    The CORBA client successfully finds the server obj ref in the naming
    service, the operation StockTraderHelper.narrow() fails in the segment
    below, with a class cast exception:
    org.omg.CORBA.Object obj =naming.resolve(...);
    StockTrader trader =StockTraderHelper.narrow(obj);
    The <obj> returned by naming service turns out to be of the type;
    class com.sun.rmi.iiop.CDRInputStream$1
    This is of the same type when stock trader object is registered in a CORBA
    server (as opposed to an RMI server), but works correctly with no casting
    excpetions..
    Any ideas / hints very welcome.
    thanks in advance,
    -hari

    On the contrary... all that is being said is that we needed to provide clearer examples/documentation in the 5.1.0 release. There will be no difference between the product as found in the service pack and the product found in the 5.1.1. That is, the only substantive will be that 5.1.1 will also
    include the examples.
    "<=one way=>" wrote:
    With reference to your and other messages, it appears that one should not
    expect that WLS RMI-IIOP will work in a complex real-life system, at least
    not now. In other words, support for real-life CORBA clients is not an
    option in the current release of WLS.
    TIA
    "Eduardo Ceballos" <[email protected]> wrote in message
    news:[email protected]...
    We currently publish an IDL example, even though the IDL programmingmodel in Java is completely non-functional, in anticipation of the support
    needs for uses who need to use IDL to talk to the Weblogic server,
    generically. This example illustrates the simplest connectivity; it does not
    address how
    to integrate CORBA and EJB, a broad topic, fraught with peril, imo. I'llnote in passing that, to my knowledge, none of the other vendors attempt
    this topic either, a point which is telling if all the less happy to hear.
    For the record then, what is missing from our distribution wrt RMI-IIOPare a RMI-IIOP example, an EJB-IIOP example, an EJB-C++. In this you are
    correct; better examples are forth coming.
    Still, I would not call our RMI-IIOP implementation fragile. I would saythat customers have an understandably hard time accepting that the IDL
    programming model is busted; busted in the sense that there are no C++
    libraries to support the EJB model, and busted in the sense that there is
    simply no
    support in Java for an IDL interface to an EJB. Weblogic has nothing to doit being busted, although we are trying to help our customers deal with it
    in productive ways.
    For the moment, what there is is a RMI (over IIOP) programming model, aninherently Java to Java programming model, and true to that, we accept and
    dispatch IIOP request into RMI server objects. The way I look at it is this:
    it's just a protocol, like HTTP, or JRMP; it's not IDL and it has
    practically nothing to do with CORBA.
    ST wrote:
    Eduardo,
    Can you give us more details about the comment below:
    I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult ot
    use an idl client in java to work.It seems to me that Weblogic's RMI-IIOP is a very fragile
    implementation. We
    don't need a "HelloWorld" example, we need a concrete serious example(fully
    tested and seriously documented) that works so that we can get a betteridea
    on how to integrate CORBA and EJB.
    Thanks,
    Said
    "Eduardo Ceballos" <[email protected]> wrote in message
    news:[email protected]...
    Please post request to the news group...
    As I said, you must separate the idl related classes (class files and
    java
    files) from the rmi classes... in the rmic step, you must set a newtarget
    (as you did), emit the java files into that directory (it's not clearyou
    did this), then remove all the rmi class files from the class path... ifyou
    need to compile more classes at that point, copy the java files to theidl
    directly is you must, but you can not share the types in any way.
    I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult otuse
    an idl client in java to work.
    Harindra Rajapakshe wrote:
    Hi Eduardo,
    Thanks for the help. That is the way I compiled my CORBA client, by
    separating the IDL-generated stubs from the RMI ones, but still I
    get a
    CORBA.BAD_PARAM upon narrowing the client proxy to the interfacetype.
    Here's what I did;
    + Define the RMI interfaces, in this case a StockTrader interface.
    + Implement RMI interface by extendingjavax.rmi.PortableRemoteObject
    making
    it IIOP compliant
    + Implemnnt an RMI server, and compile using JDK1.2.2
    + use the RMI implementation to generate CORBA idl, using RMI-IIOPplugin
    utility rmic;
    rmic -idl -noValueMethods -always -d idl stock.StockTraderImpl
    + generate Java mappings to the IDL generated above, using RMI-IIOPplugin
    util,
    idlj -v -fclient -emitAll -tf src stocks\StockTrader.idl
    This creates source for the package stock and also
    org.omg.CORBA.*
    package, presumably IIOP type marshalling
    + compile all classes generated above using JDK1.2.2
    + Implement client (CORBA) using the classes generated above, NOTthe
    RMI
    proxies.
    + start RMI server, with stockTrader server obj
    + start tnameserv
    + start CORBA client
    Then the client errors when trying to narrow the obj ref from the
    naming
    service, into the CORBA IDL defined interface using,
    org.omg.CORBA.Object obj =naming.resolve(nn);
    StockTrader trader =StockTraderHelper.narrow(obj); // THIS
    ERRORS..!!!
    throwing a CORBA.BAD_PARAM exception.
    any ideas..?
    Thanks in advance,
    -hari
    ----- Original Message -----
    From: Eduardo Ceballos <[email protected]>
    Newsgroups: weblogic.developer.interest.rmi-iiop
    To: Hari Rajapakshe <[email protected]>
    Sent: Wednesday, July 26, 2000 4:38 AM
    Subject: Re: problem using CORBA clients with RMI/EJBservers..!!!???
    Please see the post on june 26, re Errors compiling... somewherein
    there,
    I suspect, you are referring to the rmi class file when you are
    obliged
    to
    completely segregate these from the idl class files.
    Hari Rajapakshe wrote:
    Hi,
    I have a question on using EJB / or RMI servers with CORBA
    clients
    using
    RMI-IIOP transport, which in theory should work, but in practice
    has
    few
    glitches.
    Basically, I have implemented a very simple server,
    StockTreader,
    which
    looks up for a symbol and returns a 'Stock' object. In the firstexample, I
    simplified the 'Stock' object to be a mere java.lang.String, so
    that
    lookup
    would simply return the 'synbol'.
    Then I have implemented the above, as an RMI-IIOP server (case
    1)
    and a
    CORBA server (case 2) with respective clients, and the pair of
    client-servers work fine as long as they are CORBA-to-CORBA andRMI-to-RMI.
    But the problem arises when I tried using the RMI server (via
    IIOP)
    with
    the
    CORBA client, when the client tries to narrow the object ref
    obtained
    from
    the naming service into the CORBA idl defined type (StockTrader)
    it
    ends
    up
    with a class cast exception.
    This is what I did to achieve the above results:
    [1] Define an RMI interface StockTrader.java (extending
    java.rmi.Remote)
    with the method,
    public String lookup( String symbol) throws RMIException;
    [2] Implement the StorckTrader interface (on a
    PortableRemoteObject
    derived
    class, to make it IIOP compliant), and then the server to
    register
    the
    stock
    trader with COS Naming service as follows:
    String homeName =....
    StockTraderImpl trader =new StockTraderImpl();
    System.out.println("binding obj <" homeName ">...");
    java.util.Hashtable ht =new java.util.Hashtable();
    ht.put("java.naming.factory.initial", args[2]);
    ht.put("java.naming.provider.url", args[3]);
    Context ctx =new InitialContext(ht);
    ctx.rebind(homeName, trader);
    [3] Generate the RMI-IIOP skeletons for the Implementation
    class,
    rmic -iiop stock.StockTraderImpl
    [4] generate the IDL for the RMI interface,
    rmic -idl stock.StockTraderImpl
    [5] Generate IDL stubs for the CORBA client,
    idlj -v -fclient -emitAll StockTraderImpl.idl
    [6] Write the client to use the IDL-defined stock trader,
    String serverName =args[0];
    String symList =args[1];
    StockClient client =new StockClient();
    System.out.println("init orb...");
    ORB orb =ORB.init(args, null);
    System.out.println("resolve init name service...");
    org.omg.CORBA.Object objRef
    =orb.resolve_initial_references("NameService");
    NamingContext naming=NamingContextHelper.narrow(objRef);
    ... define a naming component etc...
    org.omg.CORBA.Object obj =naming.resolve(...);
    System.out.println("narrow objRef: " obj.getClass() ":"
    +obj);
    StockTrader trader =StockTraderHelper.narrow(obj);
    [7] Compile all the classes using Java 1.2.2
    [8] start tnameserv (naming service), then the server to
    register
    the
    RMI
    server obj
    [9] Run the CORBA client, passing it the COSNaming service ref
    name
    (with
    which the server obj is registered)
    The CORBA client successfully finds the server obj ref in the
    naming
    service, the operation StockTraderHelper.narrow() fails in thesegment
    below, with a class cast exception:
    org.omg.CORBA.Object obj =naming.resolve(...);
    StockTrader trader =StockTraderHelper.narrow(obj);
    The <obj> returned by naming service turns out to be of the
    type;
    class com.sun.rmi.iiop.CDRInputStream$1
    This is of the same type when stock trader object is registeredin a
    CORBA
    server (as opposed to an RMI server), but works correctly with
    no
    casting
    excpetions..
    Any ideas / hints very welcome.
    thanks in advance,
    -hari

  • Use private function with interface

    I'm working with ActionScript 2 and wanted to use an
    interface for one of my classes. However, the functions that it
    would define should be private in the classes that implement the
    interface. The problem is that I can't define private functions in
    the interface, and if I leave off any scope in the interface
    ("function findAndSetInformation():Void;") and make it private in
    the implementing class ("private function
    findAndSetInformation():Void {...") I get the error: "The
    implementation of the interface method doesn't match its
    definition.

    WHATS UP ?? WHERE IS TEH MODERATOR ?!!!!
    NO REPLY TELL NOW !!!!
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Yh:
    hi,
    how can i used REPLACE function with LOB database item????!!!1<HR></BLOCKQUOTE>
    null

  • Creating Report using EPM Functions with Dynamic Filters

    Hi All,
    I am new to BPC, In BPC 7.5 i seen like we can generate EPM report using EVDRE function very quickly and easy too. Is the same feature is existing in BPC 10.0 ? if no how can we create EPM reports using EPM Functions with Dynamic Filters on the Members of the dimension like in BPC 7.5.
    And i searched in SDN, there is no suitable blogs or documents which are related to generation of Reports using EPM Functions. All are described just in simple syntax way. It is not going to be understand for the beginners.
    Would you please specify in detail step by step.
    Thanks in Advance.
    Siva Nagaraju

    Siva,
    These functions are not used to create reports per se but rather assist in building reports. For ex, you want to make use of certain property to derive any of the dimension members in one of your axes, you will use EPMMemberProperty. Similary, if you want to override members in any axis, you will make use of EPMDimensionOverride.
    Also, EvDRE is not replacement of EPM functions. Rather, you simply create reports using report editor (drag and drop) and then make use of EPM functions to build your report. Forget EvDRE for now.
    You can protect your report to not allow users to have that Edit Report enabled for them.
    As Vadim rightly pointed out, start building some reports and then ask specific questions.
    Hope it clears your doubts.

  • 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

  • How can we use DECODE function in where clause.

    Hi Guys,
    I have to use DECODE function in where clause.
    like below
    select * from tab1,tab2
    where a.tab1 = b.tab2
    and decode(code, 'a','approved')
    in this manner its not accepting?
    Can any one help me on this or any other aproach?
    Thanks
    -LKR

    >
    I am looking for to decode the actual db value something in different for my report.
    like if A then Accepted
    elseif R then Rejected
    elseif D then Denied
    these conditions I have to check in where clause.
    >
    what are you trying to do?
    may be you are looking for
    select * from tab1,tab2
    where a.tab1 = b.tab2
    and
       (decode(:code, 'A','Accepted') = <table_column>
        or
        decode(:code, 'R','Rejected') = <table_column>
       or
        decode(:code, 'D','Denied') = <table_column>
       )

  • Using decode function without negative values

    Hi friends
    I am using oracle 11g
    I have at doubt regarding the following.
    create table Device(Did char(20),Dname char(20),Datetime char(40),Val char(20));
    insert into Device values('1','ABC','06/13/2012 18:00','400');
    insert into Device values('1','abc','06/13/2012 18:05','600');
    insert into Device values('1','abc','06/13/2012 18:55','600');
    insert into Device values('1','abc','06/13/2012 19:00','-32768');
    insert into Device values('1','abc','06/13/2012 19:05','800');
    insert into Device values('1','abc','06/13/2012 19:10','600');
    insert into Device values('1','abc','06/13/2012 19:15','900');
    insert into Device values('1','abc','06/13/2012 19:55','1100');
    insert into Device values('1','abc','06/13/2012 20:00','-32768');
    insert into Device values('1','abc','06/13/2012 20:05','-32768');
    Like this I am inserting data into table for every 5 minutes Here i need the result like
    output:
    Dname 18:00 19:00 20:00
    abc 400 -32768 -32768
    to retrieve this result i am using decode function
    SELECT Dname,
    MAX(DECODE ( rn , 1,val )) h1,
    MAX(DECODE ( rn , 2, val )) h2,
    FROM
    (SELECT Dname,Datetime,row_number() OVER
    (partition by Dname order by datetime asc) rn FROM Device
    where substr(datetime,15,2)='00' group by Dname.
    According to above data expected result is
    Dname 18:00 19:00 20:00
    abc 400 600(or)800 1100
    This means I dont want to display negative values instead of that values i want to show previous or next value.
    Edited by: 913672 on Jul 2, 2012 3:44 AM

    Are you looking for something like this?
    select * from
    select dname,
           datetime,
           val,
           lag(val) over (partition by upper(dname) order by datetime) prev_val,
           lead(val) over (partition by upper(dname) order by datetime) next_val,
           case when nvl(val,0)<0  and lag(val) over (partition by upper(dname) order by datetime) >0 then
             lag(val) over (partition by upper(dname) order by datetime)
           else 
             lead(val) over (partition by upper(dname) order by datetime)
           end gt0_val
    from device
    order by datetime
    where substr(datetime,15,2)='00';Please take a look at the result_column gt0_val.
    Edited by: hm on 02.07.2012 04:06

  • Using modular functions with movieclips

    hi guys, this morning i was looking a tutorial that shows how to make modular functions, the user only used numbers, i was wandering if there is a way to use this with movieclips or childs.
    The example was:
    function addNumber(num1:Number,  num2:Number,  num3:Number):void
    trace(num1+num2*num3);
    addNumber(3, 4, 7);
    i tried using a movieclip called cuadro and triying to move on the x axis, but it didnt work out:
    function mObj(obj1:MovieClip,  num1:Number):void
    obj1.x = num1;
    addNumber(cuadro, 50);
    any sugestion?
    thnks in advance

    oh sorry my bad, i was trying another stuff
    i know that the last line must say
    mObj(cuadro, 50);
    what im trying to do is use the function with some objects in the stage, and for example when i press the first button, it will write mObj(cuadro1, 50) , button2  mObj(cuadro2, 80), so i can use the same function for diferents objects

  • Using Multiple Functions with in members selection of Hyperion Financial St

    Hello everyone, I am trying to retrieve all the level 0 entity members from a specific Level 3 entity member. Can I use multiple Functions with in Report studio to do this?? Or is creating an alt hierarcy my only option?
    Thanks

    You can try doing System Defined member list Lev 0 AND Descendants of Lv 3 member
    JTS

Maybe you are looking for

  • Firebird Won't Start

    I added mozilla-firebird tonight. Running MozillaFirebird either from a terminal in xfwm4 or from the xfwm4 menu after appropriate edits of ~/.xfce4/menu.xml I get -bash:MozillaFirebird: command not found What's wrong with this picture? :? jlowell

  • Switching VM in Internet Explorer

    There are articles how to switch between Sun Java and Microsoft VM Java in MS Internet Explorer 6. Unfortunately the descriptions fail to say, that you need administrator rights. Or at least in the case of Windows XP Professional wSp2 client in the W

  • Satellite L650-13C (PSK1EE) overheating

    Hello all, I am new owner of Toshiba L650-13C (PSK1EE) (i3 330M, Intel HD graphics, 4GB RAM, Intel HM55 Chipset) and I have got problem with overheating. I dont know, is it really normal, but my notebook (measured by Everest) has core temp 55 - 58 C

  • Can't create space on drive

    For some reason, no matted how many files I trash, I can not get any more space on my drive. I have a 150GB drive. By looking at a Finder window at the root, there are six folders. Applications, Applications (OS 9), Library, System, System Folder (OS

  • Database sql report

    remove please Edited by: Jay on Mar 5, 2013 11:36 AM