More complex queries ???

hi all,
Can you tell me anyone, where can I found more complex queries for oracle sql expert exam ?
thx in advance

Hi Christopher,
have you checked out chapter 20 of the BPEL developers guide, at otn.oracle.com/bpel?
It covers the dbadapter. Also we have many samples with the install, check out samples/tutorials/122.DBAdapter/PureSQLSelect.
The most advanced solution, if you know TopLink well enough, is to use descriptor ammendment to express any complex sql using TopLink's proprietary expression API. Your ammendment class is written in java and must be on the appserver's classpath. You could check out the toplink otn forum for more info about that.
Thanks
Steve

Similar Messages

  • REF partitioning is affecting on complex queries

    Hi,
    I am having 7 tables consider A,B,C,D,E,F,G. whereas A is master table and others are dependent on table A. columnA is referential key for all tables. Table A is having one DateRange column.
    I have successfully created range partitioning with partitioning key is DateRange. and Refeernce partitioning on other tables with column referring to ColumnA with foreign key.
    Also created local indexes on partitioned key DateRange.
    Problem is that, while fetching complex queries for reports, it is taking more time as compared to non partitioning structure. Is ref partitioning affecting on complex queries, queries returning more rows ??? Please suggest me about it.
    Thanks,
    Avinash.

    Did I miss anything ?Depends on what you've read about it sofar and why you decided to implement it.
    http://www.oracle-base.com/articles/11g/partitioning-enhancements-11gr1.php#reference_partitioning
    "The following conditions and restrictions apply to reference partitioning:
    The child table must specify a referential integrity constraint defined on the table being created. This constraint must be in ENABLE VALIDATE NOT DEFERRABLE state (the default) and refer to a primary or unique key on the parent table.
    The foreign key columns referenced in constraint must be NOT NULL.
    The constraint cannot use the ON DELETE SET NULL clause.
    The parent table referenced must be an existing partitioned table. All partitioning methods except interval partitioning are supported.
    The foreign key cannot contain any virtual columns.
    The referenced primary key or unique constraint on the parent table cannot contain any virtual columns.
    Reference partitioning cannot be used for index-organized tables, external tables, or domain index storage tables.
    A chain of reference partitioned tables can be created, but constraint used can't be self-referencing.
    The ROW MOVEMENT setting for both tables must match.
    Reference partitioning cannot be specified in a CREATE TABLE ... AS SELECT statement."

  • Documenting complex queries

    I'd like to start providing better documentation along with the database objects I produce. What's the best way to document what's going on in complex queries? I've started trying out different techniques of documenting source/target in a spreadsheet, but it seems to be lacking. I was wondering what others do? Any suggestions or references you could point me to? I could probably improve upon my inline comment practices, so any suggestions there are also welcome. Thanks

    I’ve encountered the problem before and got some good advice here: Re: Documentation help:  Procedural logic Vs Set logic
    Because SQL is an explicit language, and programmers being in the mental state that they are when programming, it’s difficult for us to deconstruct our perfectly explicit, self-documenting SQL statement into something that someone else will understand.
    The diagram linked in the above forum thread is an example where to explain what I’m doing, I’ve had to change the set-based logic of the SQL statement into a procedural loop type explanation. I hated doing this, but it was the best way I could think of to explain it to someone.
    More recently I’ve had to document a query that is fairly simple logically (to me anyway) but due to the number of tables and the fact that the audience doesn’t necessarily understand spatial queries, I found it easier to break it down using the following diagram:
    http://img.photobucket.com/albums/v115/whitehat/work%20related/query1.jpg
    tables probably won’t mean anything to you, but you can see how I’ve broken it down into business-logic “Retrieve criteria for exception checking”, “select providers”, “restrict providers” etc. the arrows represent the join criteria and the boxes split up the driving tables and the restriction tables.
    I’ve found this particular diagram very useful as part of the current project that I’m involved with. Even the System Testers are relying on this diagram to direct them in how everything fits together.
    Each situation is different however and you’ll just have to experiment with each bit of code as it comes along.
    Hope this helps!

  • Complex queries in Open SQL

    Moved to performance forum by moderator
    Hi Experts,
    This is more of a discussion rather than a question. I would like to know the advantages of Open SQL. It prevents you from writing complex queries, the kind of queries that you can write in native sql.
    The biggest disadvantage I feel is that you have to fetch data into internal tables and loop. This takes a lot of processing time when you have a report having a lot of lines. A complex query using complex joins and subqueries will always perform better than having to loop and process data and simple things like generating sequence.
    The best thing about open sql is the way it handles select options.
    I would like to get your opinions and suggestions how to write complex queries in ABAP with some code snippets if possible.
    Warm Regards,
    Abdullah
    Edited by: Matt on Jan 21, 2009 6:54 PM

    > select - endselect will query the database repeatedly and wont be any different from using a loop on
    > internal table.
    that is a  very common misunderstanding, but not true, it uses the arry interface, but gives you the possibility to react on every line. But interaction with DB is in blocks.
    The biggest advantage of Open SQL is the implementation of the table buffer, every Open SQL Statement checks the buffers first.
    Other advantage, all statements changing table definitions are not allowed.
    And of course, as already said, it is a set of commands available on all DB platforms certified for SAP software, i.e. IBM, Oracle, Max DB and Microsoft.
    Complex queries, even with the available joins you can write very very complex queries ... sometimes too complex. I see not advantage for a competetion of writing the most complex statement
    Siegfried

  • OBIEE generates complex queries

    Hi,
    Currently we are experiencing performance issues, i.e. some queries are running for a very long time. I examined these queries and it struck me that it could be caused by the complexity of the generated queries. For example, a query accessing only one facttable accessed that facttable 5 times (the queries are concatenated through the WITH statement) ! I wonder, why is this necessary? Business Objects XI does not generate such complex queries, BO XI would access that facttable only one time.
    Basically my question is: which settings affect the queries generated by OBIEE? Isn't it possible to generate different, simpler queries?
    TIA,
    EriK

    Thanks guys. Bad design could be a reason.. but we're using Oracle's own product called BI-APPS and I expect that to be perfect...:-)
    Here is an example of a query that is imho way too complex:
    WITH
    SAWITH0 AS (select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER),
    SAWITH1 AS (select distinct SAWITH0.c2 as c1,
    SAWITH0.c3 as c2,
    SAWITH0.c1 as c3,
    SAWITH0.c1 as c4,
    SAWITH0.c1 as c5
    from
    SAWITH0),
    SAWITH2 AS (select distinct SAWITH1.c1 as c1,
    SAWITH1.c2 as c2,
    SAWITH1.c3 as c3
    from
    SAWITH1),
    SAWITH3 AS (select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER),
    SAWITH4 AS (select distinct SAWITH3.c2 as c1,
    SAWITH3.c3 as c2,
    SAWITH3.c1 as c3,
    SAWITH3.c1 as c4,
    SAWITH3.c1 as c5
    from
    SAWITH3),
    SAWITH5 AS (select sum(SAWITH4.c4) as c4,
    SAWITH4.c1 as c5
    from
    SAWITH4
    group by SAWITH4.c1),
    SAWITH6 AS (select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER),
    SAWITH7 AS (select distinct SAWITH6.c2 as c1,
    SAWITH6.c3 as c2,
    SAWITH6.c1 as c3,
    SAWITH6.c1 as c4,
    SAWITH6.c1 as c5
    from
    SAWITH6),
    SAWITH8 AS (select sum(SAWITH7.c5) as c3
    from
    SAWITH7)
    select SAWITH2.c1 as c1,
    SAWITH2.c2 as c2,
    SAWITH2.c3 as c3,
    SAWITH5.c4 as c4,
    SAWITH8.c3 as c5
    from
    SAWITH2,
    SAWITH5,
    SAWITH8
    where ( nvl(SAWITH2.c1 , 'q') = nvl(SAWITH5.c5 , 'q') and nvl(SAWITH2.c1 , 'z') = nvl(SAWITH5.c5 , 'z') )
    Basically the query is:
    select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER
    but this query is repeated multiple times. It looks like a self join - but why is OBIEE generating such a complex query? And can it be affected?
    Edited by: user10984315 on 18-Mar-2011 08:29
    Edited by: user10984315 on 18-Mar-2011 08:30

  • Creating custom classes from a more complex DTD

    Are there any examples of creating more complex custom document types? The sample in the dev. guide and the xml syntax are a good start but not enough.
    If anyone has an example from their own work, I'd appreciate it. You can send them to [email protected]
    Thanks!

    I'm having trouble gaining access to the content of those objects within a multilevel tree structure once the XML file has been loaded into the database. Those attributes off root via an editing tool or jsp/bean are rendered; however, the branched object structures are not. Instead the following is in its place: <MYClASSOBJECT2 RefType="ID">7265<!--ClassObject: MYClASSOBJECT2--><!--Name:Null--></MYClASSOBJECT2>
    Here is some background. All custom classes have been successfully loaded into iFS, including the branching objects, which have been entered as extensions of Document as well as the associated ClassDomain entries. I've read Mark's PencilObject entry of June 23, but I continue to get undesired results. Currently, I am using SimpleXMLRender and am inclined to believe that I will need to customize the renderer for it to recognize the deep structures within my XML. Can you shed any light on my situation? In a nutshell, how do I gain access to the content within my multilevel XML?

  • Which module is more complex to meet requirements?

    Dear SDN,
    If you compare LO (SD,MM,PP,etc), FI (AR,AP,GL,SL) ,
    which module of extraction is most complex for a pure BW person? I mean a BW person who did not have R/3 experience?
    Regards
    pascal

    Hi,
    In terms of quantity I would say LO will be more complex as it covers a lot of modules like SD, MM, etc. FI is one big module wiht lot of submodules.
    But from an understanding perspective, FI will be much more complex. 
    Cheers,
    Kedar

  • More complex JCO Server examples (ABAP to Java)

    JCo connections:
    I found a couple of good documents for connecting from Java to ABAP. Whenever it comes to the other direction (ABAP to Java), information is somehow rare.
    I had a look at the examples coming with the JCo lib, however I would like to find some more complex examples. Especially the transfer of larger result sets (obtained on the Java side) is interesting.
    Does anybody know something like this? I have tried Google, but somehow always the same few articles showed up.
    Any hints?

    You can also use the JCO RFC Provider Service of the Web Application Server for your ABAP to Java calls.
    The steps involved in that are
    1. Configure destination in SM59 in SAP.
    2. Create RFC Destination in Visual Admin.
    3. Create a stateless session bean with JNDI name as the name of calling function module in SAP.
    4. Add a business method public void processFunction(JCO.Funtion fn) which is called by the JCO RFC Provider Service. The name should be 'processFunction'.
    5. Set library references in application-j2ee-engine.xml to type weak for the following
        a. com.sap.mw.jco.
        b. com.sap.tc.Logging (if you are using the logging api )
    Here is the sample code for the EJB biz method
    Business Method.
         public void processFunction(JCO.Function function) {
              try {
                   // Get the import parameters for the function module
                   JCO.ParameterList importList = function.getImportParameterList();
                   logger.infoT("The value sent is" +
                   (String)importList.getValue("USER_NAME"));
                   // Set the export parameter value for the function module
                   JCO.ParameterList export = function.getExportParameterList();
                   export.setValue("From EJB", "RETURN");
                   function.setExportParameterList(export);
              catch (java.lang.Exception e) {
                   e.printStackTrace();     

  • Please some one can explain about some complex queries

    BW Guru's,
    please some one can explain about some complex queries which was created while working on Reporting.
    I need to create profit and loss query as per requirment on the FL-Gl cube.
    Answer would be appreciate in advance.
    Regards
    Krish

    HI Aryan,
    No need to create FM on your own. You can copy the FM from Function Group RSAX.
    The procedure to create FM extractor is as follows:
    1) Create an extract structure.
    2) Go to SE80. Select Function Group RSAX , right click and then copy.
    3) Give your own name to the function group to copy.
    4) Select one appropriate FM from the list of FMs provided. eg FM RSAX_BIW_GET_DATA_SIMPLE.
    5)Specify the name of new FM you want to create.
    6) Go to SE37 and open the FM you have created by copying from Function Group RSAX.
    7) no need to change the import tab.
    8) On tables tab, for paramerter name E_T_DATA under asociate name specify the name of extract structure you hav created.
    9) Under source code tab make the changes in the source code only to customise it to your requirement. eg: declare the database table you are using, make changes where datasource is in picture, etc.
    I have created a generic DataSource with the help of above procedure.. I hope you will find it helpful...
    Regards,
    Geetanjali

  • Differentiate between Simple, Medium and Complex Queries.

    Hi Gurus,
    I am a Tech. Architect on this new project. I would like to know how to differentiate between Simple, Medium and Complex Queries in BW because I need this info to work on the Estimates. Has this differentiation got anything to do with the Backend config also?
    Thanks in Advance.
    Chandu.

    Hi
    You need to understand the requirements and consider the following before you classify........
    1) Queries that are based on multiple key figures--which may result in cell definition.
    2) Queries with complex calculations.
    3) Queries that are based on Variable Exits
    Regards
    Srinivas Bandi

  • IMPLEMENTING PAGEWISE CONCEPT FOR COMPLEX QUERIES FOR WEB BASED TECHNOLOGIES

    Dear Friends
    how do i implement Page Wise concept for complex queries. Complex queries includes 'Group by', 'from selects'. Mere Rownum selection doesnt solve my problem. I have 3 buttons 'Previous', 'Next' and 'display of No. of records' . Kindly suggest me with a solution.

    The only widespread way is dynamically bild a SQL clause then parse and execute it using dynamic sql (package dbms_sql) or native dynamic sql (execute immediate clause).
    You can go through your already built cursor and display only those records you need (for example from 10th to 20th). I think there is no way to leave cursor open and reuse it another time. Every time You hit next, back or count button you need build new cursor (either selecting context columns to show some records or selecting count(*) to show number of records). You can generate this code with Oracle Designer, making webserver modules. Of course this will cost rather many $$$. Another tip - Designer makes this code for all situations and therefore it is somewhat difficult to understand it in the beginning. If you really need some example I can send something to you.

  • Want complex queries

    Hi,
    Where can i find the SQL queries(unsolved) through which i can learn to write complex queries...
    As I am a novice programmer it would be better if the range varies from easy to complex ones.
    Thanks in advance.
    Mythili

    Actually for me a skill full SQL developer is one who can solve a complex problem with a simple SQL. Not the one who can write complex SQL ;)
    Some of the places from where i learn new and exiting stuff ever day are
    [Asktom.oracl.com |http://asktom.oracle.com/pls/asktom/f?p=100:1:146758316283624]
    [forums.oracle.com|http://forums.oracle.com/forums/main.jspa?categoryID=84]
    [Richard footes oracle blog|http://richardfoote.wordpress.com/]
    [Oracle Document is always there|http://tahiti.oracle.com/]
    These places are not going to make you a great SQL Developer in a day. You have to be there and keep learning constantly. Without your knowledge over a period of time your approach towards SQL will change. And change is good ;)

  • Complex Queries.

    Hi Gang,
    I was in an interview last week and was asked to give an example of a complex queries I have worked with. I was really cought off guard and could not give a very intelligent answer other than mumbling. Can someone please help me out with real life examples? May be I will be asked the same in my next interview.
    Thanks,
    Kara.

    There are many features available in BEx querying, I would think that being able to discuss how / why you used some of them in the same query is what they are looking for, e.g. 
    - Creating RKFs with restrictions on several characteristics
    - Using variable offsetsto get KFs form different time periods
    - A case where using Constant Selection was needed.
    - Using some of the various totaling options.
    - Use of MultiProvider that includes Cube, ODS, and Master Data.
    Now if you haven't actually designed any quereis, this can be a challenge........

  • Complex Queries Developed in Desktop for Plus Users

    I develop complex queries in Discoverer desktop, with complex calculations and conditions and customized report formats. I understand that my "Plus" users can run them all. Is that correct?
    What about my "Viewer" users?

    Hi,
    The "Viewers" users can run any complex report, equally like "Plus". The reports would have to be shared with the Viewers users.
    Discoverer desktop is a client side development tool and Plus is the "Equivalent" web version. So complex calculations/conditions should not affect.
    Thanks.

  • Answers access with Java (to enable more complex reports)?

    Hello and thanks for reading,
    I was wondering if there is a possibility to access BI Answers with Java (or an other procedural language) in order to realize more complex reports than what is possible with the graphical user interface.
    Is there an alternative way to access BI Answers in order to build reports, which provides one with a great flexibility in report design?
    Thanks for ideas
    Evgeny

    Are you trying to build more complex reports in OBIEE?
    If you need to customize the obiee you can do by editing the html files in BI server and data folders. You can add ur own html code and tags there. Also to achive more complex formating you can use OBIEE Publisher that will let you to create your own rtf or pdf templates and upload it to the dashboards
    Hope it helps
    Prash

Maybe you are looking for

  • Error in the below sql.

    Hi I am getting the below error in the below sql Hi I am getting the error in the below sql DECLARE    pgm_id                  NUMBER := &1;    schd_dt                 DATE := TO_DATE('&2','MM/DD/YYYY');    l_schd_dt               DATE := NULL;    l_

  • Is there a limit to Azure Baidu push? What are the tech specs around delivery?

    Is there a max_allowed_push_sent/unit_of_time?   And, is there any information regarding send rate?  e.g.  We can send 1 million push minute, or more?  Or less?

  • How to multiple objects stored in a file.

    Hi, there is a file on which multiple object have been written. Now while reading it back, is it necessary to read the objects in the same sequence in which they were written or i can randomly read any object? thanx deepak saini

  • Item Master Data Creation - Statuses

    Greetings, My client is looking for best practice - status naming conventions for Item Master Data Creation Process. They are in the Specialized Retail Industry and have internal naming conventions and want to align more with Industry Standards.  The

  • I cannot find my apps

    I have a Mac book pro and my partner has an iPad...when I synced her iPad to the laptop she lost her apps...they say they are installed but cannot access them...they are not on any of the screens...Help