Disco Plus and Sub-queries in conditions

Hi,
I have a strange behaviour for a report using a sub-query in the condition:
in Desktop Edition and Viewer it works just fine, in Plus no data is returned.
I am using Discoverer 9.0.2.
The condition was created from the Desktop using an existing datasheet, both data sheets using the same parameter.
I examined the SQL code from Plus and the statement returns data and the sheet with the sub-query also returns data - nevertheless the report doesn't return any data.
As far as I know you cannot create or modify sub-queries in conditions with PLus - but at least the report should work?! Does anyone know where the problem could be?
Thank you very much in advance!
Alex

Trying to create a sub-query in discoverer...
Using Desktop (9.04 and 10.1.2), the option "Create Sub-Query" is not available in the condition values. Feel like I'm missing something - has anyone come across this before?
I assume sub-queries should be possible/supported in Plus 10.1.2 (although it's not in the user guide). If so, the Create Sub-Query option is not available like in Desktop. If not, why not - seeing as it's basic sql commonly used in reporting?
Thanks!

Similar Messages

  • In which sequence are queries and sub-queries executed by the SQL Engine

    In which sequence are queries and sub-queries executed by the SQL Engine?
    Which is correct ?
    a. primary query -> sub query -> sub sub query and so on
    b. sub sub query -> sub query -> prime query
    c. the whole query is interpreted at one time
    d. there is no fixed sequence of interpretation, the query parser takes a decision on the fly

    In which sequence are queries and sub-queries executed by the SQL Engine?
    Which is correct ?
    a. primary query -> sub query -> sub sub query and so on
    b. sub sub query -> sub query -> prime query
    c. the whole query is interpreted at one time
    d. there is no fixed sequence of interpretation, the query parser takes a decision on the fly
    Hi, below may help you understanding simple subquery & correlated subquery
    refer :
    http://sqlmag.com/t-sql/t-sql-starters-simple-and-correlated-subqueries
    a) if it is correlated subquery
     A correlated subquery is one that depends on a value in the outer query. In programming terms, you pass the subroutine an argument, then the subroutine evaluates the query and returns a result. You move on to the next record and repeat the process. The
    net effect is that the subquery runs once for every row in the main query; this situation is inefficient.
                                  A possible alternative is to rewrite the correlated subquery as a join. However,
    some situations require a subquery. Eg- IN(with outer table refernce)
    so  main query -> subquery
    b) if it is simple subquery
    A subquery is a query that SQL Server must evaluate before it can process the main query, Eg- IN(with out outer table refernce)
    so subquery-> main query
    c) correlated query interpreted row by row with subquery, while subquery is interpreted at one time(outer table and inner table)
    d) in most case it depends on the whether it is correlated subquery or simple subquery
    Thanks
    Saravana Kumar C

  • Log In to Disco Plus and see all reports across all responsibilities

    Hi,
    I've got a user that has multiple different responsibilities with different reports shared with each of them. When using Discoverer Plus they have to use the 'connect to' screen to log into each responsibility separately to view their reports. Is there any way of letting them see all of their reports available across all responsibilities at once?
    Thanks,
    Neal

    Hi Neal
    I am sorry but this is not possible , at least out of the box. Access to EBS data is controlled via responsibilities and those responsibilities typically do not cross over functional areas. Your reports will all be shared at the responsibility level making it doubly difficult.
    I have been giving some thought as to how this be made to could work and here are my thoughts.
    1. Create a new responsibility, just for Discoverer
    2. Grant the new responsibility the other responsibilities
    3. Grant a selected user or group of users access to this new responsibility
    4. Log in to Discoverer using the new responsibility
    I'm making the assumption that responsibilities are cumulative, just like database roles, and if this is true then the above should work.
    Best wishes
    Michael

  • Line on Left SIde and Boxes around Headings in Disco Plus

    Anyone have any insight into the issue:
    When printing ANY table or Crosstab report from Plus, there is almost always a random line that prints on the left side margin. Also the headings/titles have light gray 'boxes' around them. I have tried ALL of the printing features/settings that are in Plus. I have been through the documentation for 10g (10.1.2.1) Disco Plus and have not found any information that could resolve my issue.
    Has anyone experienced this when printing their Disco Plus reports for the following version. This is a major issue for some of out Finance reports as presentation quality is most important aspect of the reporting tool.
    Here is the version info:
    OracleBI Discoverer 10g (10.1.2.1)
    Oracle Business Intelligence Discoverer Plus 10g (10.1.2.48.18)
    Discoverer Model - 10.1.2.48.18
    Discoverer Server - 10.1.2.48.18
    End User Layer - 5.1.1.0.0.0
    End User Layer Library - 10.1.2.48.18
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    thanks
    Mike

    Hello,
    We are also experiencing this issue. Any updates ?
    Thanks,
    Barbara

  • Usage of joins & sub-queries

    can anyone help me know the situation when to use the joins and sub-queries manipulating with more than one tables???? which among the two is faster normally???? because we can do same process using both these options.....

    Balasubramaniam:
    I think I can be so bold to say that, in general, joins are faster than sub-queries. But there are a lot of variables - data types, row/table sizes, indexes.
    Try it and compare, with your production data.
    Tom Best

  • With clause vs sub-queries

    db and dev 10g rel2 , hi all,
    i am trying to learn the "WITH CLAUSE" , and i do not see any difference between using it and using sub-queries .
    when i searched for this , i found that the with clause is used when You need to reference the subquery block multiple places in the query by specifying the query name , but i can not imagine an example for doing so .
    if you could provide me with an example please ? and telling me about another situations in which i could need using the "with clause" if any ?
    thanks

    >
    db and dev 10g rel2 , hi all,
    i am trying to learn the "WITH CLAUSE" , and i do not see any difference between using it and using sub-queries .
    when i searched for this , i found that the with clause is used when You need to reference the subquery block multiple places in the query by specifying the query name , but i can not imagine an example for doing so .
    if you could provide me with an example please ? and telling me about another situations in which i could need using the "with clause" if any ?
    >
    It isn't just about referencing a subquery multiple times. There are other advantages to using 'common table expressions'/'subquery factoring' also.
    Take a look at the example below. It first defines 'dept_costs' as a query block, then defines 'avg_cost' as a new query block and it references the first query block.
    Then the actual query references both query blocks just as if they are tables. And, in fact, in some circumstances Oracle will actually materialize them AS temporary tables.
    Look at how easy it is to understand the entire statement. You can focus first on the 'dept_costs' query block WITHOUT having to look at anything else. That is because the query block is self-contained; you are defining a result set. There is no 'join' or connection to any other part of the statement.
    It is easy for a developer, and for Oracle, to understand what is needed for that one piece.
    Next you can focus entirely on the 'avg_cost' query block. Since it uses the first query block just as if it were a table you can treat it as a table. That means you do NOT even need to look at the first query block to understand what the second query block is doing.
    Same with the actual query. You can analyze it by treating the two query blocks just as if they were other tables.
    Even better you can test the first query block by itself in sql*plus or other tool to confirm that it works and you can create an execution plan for it to make sure it will use an appropriate index. You can also then test the first and second query blocks together to make sure THEY have a proper execution plan.
    Then when you test then entire statement you already know that the query blocks work correctly.
    Try to do THAT with a query that uses nested sub-queries.
    Sure - you could write a set of nested sub-queries to accomplish the same thing (Oracle will sometimes rewrite your query that way itself) but it becomes one big query and the individual pieces are not nearly as easy to see, analyze or understand.
    It can be difficult if not impossible to extract a nested query in order to test it even to just try to get the syntax working. And when you do extract it you will often be testing something that isn't quite exactly the same as when i t was nested.
    So: easier to understand, easier to write and test (especially for new developers) as well as easier to use multiple times without having to duplicate it.
    >
    subquery_factoring_clause
    The WITH query_name clause lets you assign a name to a subquery block. You can then reference the subquery block multiple places in the query by specifying the query name. Oracle Database optimizes the query by treating the query name as either an inline view or as a temporary table.
    >
    The SQL Language doc has an example.
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_10002.htm#i2129904
    >
    Subquery Factoring: Example The following statement creates the query names dept_costs and avg_cost for the initial query block containing a join, and then uses the query names in the body of the main query.
    WITH
    dept_costs AS (
    SELECT department_name, SUM(salary) dept_total
    FROM employees e, departments d
    WHERE e.department_id = d.department_id
    GROUP BY department_name),
    avg_cost AS (
    SELECT SUM(dept_total)/COUNT(*) avg
    FROM dept_costs)
    SELECT * FROM dept_costs
    WHERE dept_total >
    (SELECT avg FROM avg_cost)
    ORDER BY department_name;
    DEPARTMENT_NAME DEPT_TOTAL
    Sales 313800
    Shipping 156400

  • Sub Queries VS  Variables in the Query

    #1
    for i in ( select a.name,b.price,a.date from
    list a, sales b
    where a.header_id=b.header_id
    and b.date_key= (select date_key from date_tab
    where date_field=trunc(sydate))
    loop
    end loop.
    #2
    select date_key into v_date_key from date_tab where date_field=trunc(sydate);
    for i in ( select a.name,b.price,a.date from
    list a, sales b
    where a.header_id=b.header_id
    and b.date_key= v_date_key)
    loop
    end loop.
    Please advice me , using the sub queries(#1) or substution variable (#2) in the condition part will improve the performance of the query.
    Thanks

    Most likely, there won't be a difference in performance.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Sub queries

    i have a longish query which runs correctly in Oracle 8i Lite thro SQL Plus but does not run when using JDBC.
    The query has multiple subqueries and it looks like
    delete from node_initial_values d where d.node_id in (select c.node_id from node_master c where c.node_id=d.node_id and c.node_id in (select e.node_id from network_design e where c.node_id=e.node_id and e.network_id in (select b.network_id from network_master b where e.network_id=b.network_id and b.network_id in (select g.network_id from output_network_scenario g where g.network_id=b.network_id and g.output_network_master_id in (select a.output_network_master_id from output_network_master a where a.output_name= 'network three')))));
    assume all the tables exist with correct data. the above query works perfectly well in SQL*plus but when i use
    the following code i get an error
    PreparedStatement deleteNodeInitialValuesPst=getConn.prepareStatement("delete from node_initial_values d where .... a where a.output_name= ?)))))");
    deleteNodeInitialValuesPst.setString(1,"network three");
    deleteNodeInitialValuesPst.executeUpdate();
    getConn.commit();
    ... rest of the code
    the error code oracle 8i lite gives is
    java.sql.SQLException: [POL-4200] bad action for transaction operation
    would really appreciate any help in this regard...
    specifically can anyone tell me if prepared statement is the correct function to use here...
    thanks

    I made the following changes:
    changes to the code, new code mentioned below
    changed the database to oracle 8i enterprise edition running on NT.
    new code now is
    // connetion parameter and other code here
    String deleteNodeInitialValuesStr=
    "delete from node_initial_values d where d.node_id in (select c.node_id from node_master c where c.node_id=d.node_id and c.node_id in (select e.node_id from network_design e where c.node_id=e.node_id and e.network_id in (select b.network_id from network_master b where e.network_id=b.network_id and b.network_id in (select g.network_id from output_network_scenario g where g.network_id=b.network_id and g.output_network_master_id in (select a.output_network_master_id from output_network_master a where a.output_name='"+nextElementStr+"')))))";
    Statement deleteNodeInitialValuesSt=getConn.createStatement();
              deleteNodeInitialValuesSt.executeQuery(deleteNodeInitialValuesStr);
    getConn.commit();
    } // end try
    catch(SQLException ex) {
         while(ex !=null){
    out.println("Java SQL Exception: " + ex.getMessage()+"<br>");
    out.println("Vendor error code: " + ex.getErrorCode()+ "<br>");
    out.println("SQL State: " + ex.getSQLState() + "<br>");
    ex=ex.getNextException();
    } // end while
    } // end catch
    // more code here
    the output i get is
    Java SQL Exception: 202
    Vendor error code: 0
    SQL State: null
    I turned off getConn.commit(), but the error code remains the same. is there an alternative to the sub queries above. where can i get the meaning of the error codes thrown by the exception ?
    thanks

  • Accrul and Account key in Condition

    Hi Experts,
    I have a specific Requirement, I have created a condition thru M/06 and attached to schema thru M/08. The problem is whenever we use this condition we want that finance entry should be like below mentioned.
    SUBCONT PROCESSING CHARGES DEBIT AND GR/IR CREDIT.
    What accrul and account key I should use in the condition.
    Full Points for helping answer.
    Regards
    GR

    Dear Andra,
    Thanks for the answer, actually in our scenario, when we sent material for subcontracting (suppose plating) vendor charges Sales Tax on 60% Value and Job Work Rate for 40% value.
    (Example Say vendor charges vat / cst on inr 6/- and No Tax or service Tax on Rs 4/- if total agreed price with the vendor is Rs 10/-). Now we have thought to maintain 6/- as basic price in subcontracing info with tax code and Rs 4/- as other condition with out any tax. Now when we have made condition and incorporate in the info. But it is hitting freight clearing/ freight inward account as accrul and account key is made for freight etc.
    Now If you say condition can not be made for GR/IR CR and Sub Proc charges DR, then in what way I should pass the vendor invoice thru MIRO. We don't want to post two miro for one invoice.
    Please help me.
    Regards
    GR

  • HP Officejet Pro 8500A Plus and I am unable to find drivers for MacOSX 10.4 Tiger

    I bought the new Office Jet Pro 8500A plus and now I cannot install it to work with my old Imac 10.4.11???
    HP only supports 10.5 onwards???
    This is unacceptable.
    Please advise how I can make this work.
    Thank you.
    Sincerely,
    JonPaul

    Hi bhappie,
    Welcome to the HP Support forums.  I gather that you are unable to connect your Officejet 8500A plus printer to your wireless network.
    This printer can be connected by an ethernet cable or connected to your wireless network but cannot support both simultaneously as referenced in the document The Printer Does Not Support Ethernet (Wired) and Wireless Network Connections at the Same Time.  To setup the wireless feature you will need to unplug the ethernet cable.  
    Your wireless printer can be easily connected to your wireless network from the front panel of your printer.  If you are unsure how to do this the instructions can be found in your User Guide on page 219 in the section titled “To set up a wireless communication using the Wireless Setup Wizard”.  
    Now that the printer has a wireless connection, any computer that uses the printer, will need to have the connection method updated.  The instructions on how to do this can also be found in your User Guide on page 221 in the section titled “Change the connection method”.  There is a sub-section dedicated to Windows operating systems and one dedicated to Mac operating systems.
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • IN clause with ORDER BY clause in sub-queries

    Hello,
    We generate dynamic queries with the following statement pattern (could be many union/intersect sub-queries):
    select my_col
    from my_table
    where my_col IN
    select table_2.my_col , x_col from table_2 where x_col > 10
    UNION
    select table_3.my_col , y_col from table_3 where y_col > 20
    INTERSECT
    select table_4.my_col , z_col from table_4 where z_col is between 30 and 50
    I know that I can do just the sub-queries w/ an ORDER BY clause as follows (as long as the 2nd parameter in the select stmts are of the same type):
    select table_2.my_col , x_col from table_2 where x_col > 10
    UNION
    select table_3.my_col , y_col from table_3 where y_col > 20
    INTERSECT
    select table_4.my_col , z_col from table_4 where z_col is between 30 and 50
    order by 2 desc
    But my questions are:
    1. What is (if there is) the syntax that will ensure that the result set order will be that of the ordering of the sub-queries?
    Or does my SQL stmt have to have syntactically (but not semantically) change to achieve this?
    Thanks,
    Jim

    Randolf Geist wrote:
    just a minor doubt - I think it is not officially supported to have separate ORDER BYs in a compound query with set operators (e.g. UNION / UNION ALL subsets). Of course one could use inline views with NO_MERGE + NO_ELIMINATE_OBY hints, but I think the only officially supported approach is to use a single, final ORDER BY (that needs to use positional notation as far as I remember).
    Randolf,
    You're right, of course, about the separate "order by" clauses.
    Interestingly the following type of thing does work though (in 10.2.0.3, at least):
    with v1 as (
        select * from t1 where col1 = 'ABC' order by col2
    v2 as (
        select * from t1 where col1 = 'DEF' order by col2
    select * from v1
    union all
    select * from v2
    ;A quick check the execution plan suggsts that Oracle appears to be convering this to the following - even though its technically not acceptable in normal circumstances:
    select * from t1 where col1 = 'ABC' order by col2
    union all
    select * from t1 where col1 = 'DEF' order by col2
    ;Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to make the start of Disco Plus / Viewer faster

    Hello,
    I open a workbook via link in Discoverer Viewer. It takes 30-60 seconds until the workbook opens.
    I have to say that the whole environment is running on a laptop with 1,5 GB Ram (for a showcase). Is there an option to make it faster? I'm a little confused because when I manually start Discoverer Plus and then open the workbook it does not take so much time.
    regards,
    Tobias

    Toki.
    One other 'trick' you can perform for making the actual query run faster once you've connected - for demo purposes only - is to not use 'real data' with many tables, views, etc. but to dump the data you want into one table. In otherwords, you create a table that has the actual data that you would get from a query, querying say 3 tables.
    Then when you're demo'ing, you get instant response as you're only using 1 table.
    This is done by a well known company when they're trying to show off their product against an Oracle database and querying with various query tools including Disco.
    Russ

  • Cannot Open Excel File after exporting from Disco Plus

    Hi there,
    I got a question from one user having issue with opening Excel file after exporting from Disco Plus.
    The report has been using for a while and he is using Excel 2003 version and Discoverer 10g(10.1.2.2), he never got this kind of error before, just recently got error.
    After exporting from Disco Plus he saved file on his desktop and when he tries to open the excel it says "Cannot be Accessed, can be corrupted...." but this is not from network drive since he saved file on local desktop or C drive.
    Also not for all reports, only this particular report and only specific parameter, for example for parameter 2008 Feb opened successfully, but for2009 Feb he gets this error when trying to open excel.
    i tried in excel 2007 also , i dont think this is Excel version error, am not sure.
    Also after go live last week (we upgraded database from 9i to 10g) but i am not sure this causes ,since for one parameter working, for other parameter not working.
    Actually we should get one window for Macro when we try to open excel, but he is not getting it seems.
    Any ideas/thoughts on this would be greatly appreciated.
    Thanks for your help
    --skat                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Rod,
    Thanks for your quick response on this.
    Yes, we can export to other formats as well, but actually exporting is working, after saving the file on our local desktop/drive and when we try to open we get this kind messages or we cannot open the file, we should get message window for Macro to enable/disable but for this report we are not getting this either,
    Also this happens only for specific parameters,like i mentioned above it works I mean excel file opens for one set of parameters but for some other set of parameters cannot open.
    For example :- when we enter FEB 2008 it works, if we enter FEB 2009 it won't open the file.
    This is weird
    I am still working on this issue, may be better to recreate the report again might be helpful,
    Any ideas/comments/thoughts would be great
    Thanks
    Skat

  • 'Count all rows' in Disco Plus?

    Hi all - I can't find an option to Count All Rows in disco plus. This is something my users use all the time in Desktop - is it included in Plus?
    In Desktop, it is under menu item 'Sheet'
    Thanks!
    Scott

    Hi Scott
    Sorry that was removed from Discoverer Plus so you won't find a button for it. Having that there would force Discoverer to have to run the entire query just to give you the total count. Oracle considered this a waste of resource and query effort, which I sort of agree with because I can see what they are getting at, and so removed it.
    Best wishes
    Michael

  • How can I create "Sub Queries" in a select statement?

    Hi all,
    I need to create reports, which are not based on a single table but on several "sub-queries".
    This would be the code, but I don't know how to solve that problem...
    SELECT OGBI.*
    FROM
    (((select "OSSRALL"."FORECAST_OWNER", sum
    ("OSSRALL"."TOTAL_OPPORTUNITY_AMOUNT")
    from "#OWNER#"."OSSRALL" "OSSRALL",
    "#OWNER#"."TEAM_MAIN" "TEAM_MAIN",
    "#OWNER#"."MA_MAIN" "MA_MAIN"
    group by "OSSRALL"."FORECAST_OWNER")OGBI.APPSME1)
    where "OSSRALL"."OPP_CLASS" = (EX_OTHERS)),
    -- more are following
    "#OWNER#"."OSSRALL" "OSSRALL",
    "#OWNER#"."TEAM_MAIN" "TEAM_MAIN",
    "#OWNER#"."MA_MAIN" "MA_MAIN"
    WHERE
    ("MA_MAIN"."MA_NAME"||', '||"MA_MAIN"."MA_FIRST_NAME"||' Mr'
    like "OSSRALL"."FORECAST_OWNER" or
    "MA_MAIN"."MA_NAME"||', '||"MA_MAIN"."MA_FIRST_NAME"||' Mrs'
    like "OSSRALL"."FORECAST_OWNER" or
    "MA_MAIN"."MA_NAME"||', '||"MA_MAIN"."MA_FIRST_NAME"
    like "OSSRALL"."FORECAST_OWNER") and
    ("OSSRALL"."SALES_GROUP"="TEAM_MAIN"."NAME") and
    ("MA_MAIN"."MA_ID"=:P17_VB1)
    thx a lot for your help.
    kind regards Jan
    Message was edited by:
    Jan Rabe

    Jan
    Please can you post the full select statement and the DDL to create the tables? Or, provide someone access to the app on the Oracle server.
    We can probably make these much more readable using table aliases and removing the owner unless you are doing this across schemas or via a wizard?
    It looks like you are missing joins in your query - is this what you mean by subqueries? It is a good idea to move the join up before the WHERE clause if you can as this makes the query easier to manage.
    Phil

Maybe you are looking for

  • I cancelled, but it didn't go through and I got charged.

    Hi, I am upset at Spotify.  I recently cancelled my account and found that you had charged me anyway.  I went back to see what was wrong and I had to confirm my cancellation three times after clicking on the initial cancellation button to fully cance

  • How to add exclude criteria in the already existing group

     I have a created a group with this criteria ( Object is Windows Computer AND ( NetBIOS Computer Name Matches wildcard *-XXX*|*-SSS*|*YYY*|*ZZZ*|*PPP|*QQQ* ) AND True ) Now i got the request to exclude NetBIOS Computer Name Like  *ABCD* . in the abov

  • Firefox doesn't open up even after reinstalling

    The window of the program opens but none of the icons are visible. I tried to reinstall Firefox but it didn't help. I don't get the message about any error. My operating system is Windows 7.

  • How do I back up my music from my iPhone 3G?

    How do I back up my music from my iPhone 3G?

  • FCP 5 TEXT ISSUES

    I have a problem with my edit and was wondering if anyone have the same problem and found a solution to it. I'm doing an edit right now and in one of the scenes I have a TEXT on top of the footage. (4 layers of text). One of the text layers have a CR