Problems with Discoverer queries

I'm building a Discoverer worksheet based off a view where I have the following select statement:
select count(2.columnA) A, count(distinct 3.columnB) B, 1.columnC, 1.columnD from
table1 1, table2 2, table3 3
where 1.columnE=2.columnA
and 1.columnE=3.columnB
group by 1.columnC, 1.columnD
When I create this worksheet in Discoverer, everything comes out fine. However, when I build the following calculation, I get incorrect results: (A - B)/A. For some reason, Discoverer does not want to divide properly. Any ideas?
Devin

Hi
I found in the manual regarding Turn off Query Prediction. / Stop Query Prediction
"Turn off Query Prediction.
This can be done by specifying the following registry key:
HKEY_CURRENT_USER\Software\Oracle\Discoverer 4\Database\QPPEnable
It should be set to a DWORD value of 0 (zero). To re-enable query prediction at some later point in time, either remove the registry key or set it to 1.
Stop Query Prediction forcing the use of the Cost-Based Optimizer.
This can be done by specifying the following registry key:
HKEY_CURRENT_USER\Software\Oracle\Discoverer 4\Database\QPPCBOEnforced
It should be set to a DWORD value of 0 (zero) which means use of the Cost-based Optimizer (CBO) is not enforced. The CBO will follow the normal rules of the database server. "
However I cannot find the specified registry keys QPPEnable and QPPCBOEnforced
What could be wrong?
Thanks
ARI

Similar Messages

  • Problems with Discoverer Viewer and the printable page

    Hi,
    I have a problem in Discoverer Viewer. I run a workbook, see the results and I click on "Printable Page". I set the page setup options to "Portait" and "100% scale". I preview the workbook in a PDF file and it's ok, I see the results in "Portait" and "100%".
    I close the PDF file and I click again on the "Printable Page". This time, I set the workbook to "Landscape" and "20% scale". I preview the workbook in a PDF file and it's NOT ok, the results are still in "Portait" and "100%". And the date/time in the workbook is the time when I run the workbook the first time. So, it's seems like a browser cache problem. The problem repeats until I clear the brower cache. At that moment, the workbook will take the page setup that I set at this time. However, it will be the same workbook with the same results until I clear the cache once again.
    If I save the PDF file on my Windows Desktop and I overwrite it each time, it's ok.
    Can somebody help me on this??
    Thank you!
    Mathieu

    Hi Michael,
    I'm clearing the browser cache by going in Tools -> Internet Options. In the "General" tab, I click on the "Delete files..." in the "Temporary Internet Files" section" (middle of the window).
    But I don't indicate that Discoverer is saving my printable page changes. I say that the first time I run a workbook, Discoverer saves it (the results) in the "Temporary Internet Files" folder in a PDF file. Each time I run the same workbook after that, Discoverer don't overwrite the file in the "Temporary Internet Files" folder. He takes the PDF file that is already there and show it to me. So, the results are the same even if the data has changed. It does this until I clear the browser cache (it deletes the PDF file in the "Temporary Internet Files" folder).
    Do you understand?
    Regards,
    Mathieu

  • Problem with Join Queries using PHP and an Orcale Database

    Ok, I am trying to build a simple php querying tool for my oracle database and for the most part it is working however I am having a problem getting data from my join queries. If I run the following query :
    QUERY:
    SELECT lastfirst,EnteredBy,Debit FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    Lastfirst     EnteredBy     Debit
    caiu, test      204     1
    But when I run the query correctly I get no results
    QUERY:
    SELECT sts.lastfirst,gl.EnteredBy,gl.Debit FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    sts.lastfirst     gl.EnteredBy     gl.Debit
    and if I run the query combining the two above methods and adding a field (schoolid) that has the same name on both table I get the following result sets
    QUERY:
    SELECT lastfirst,EnteredBy,Debit,sts.schoolid FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    lastfirst     EnteredBy     Debit     sts.schoolid
    caiu, test      204     1     
    QUERY:
    SELECT lastfirst,EnteredBy,Debit,schoolid FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    NONE
    Therefore, I have to have something written incorrectly in my php code and I just can not figure it out. My entire code is pasted below please provide me with an assistance you might have to offer. I have change the odbc_connec line so I could post it to this forum. In addition, I had to phrase out the column headers there for when you write the column headers you have to use ~ instead of , as the separator and then I turn back into the correct format for sql.
    //These scripts just open help windows if somone clicks on the icon
    <script>
    function submit()
    {document.sqlform.submit();}
    </script>
    <script>
    function colwin(){
    window.open("colnames.php",null,"height=300,width=400,scrollbars=1");}
    </script>
    <script>
    function tabwin(){
    window.open("tablenames.php",null,"height=300,width=400,scrollbars=1");}
    </script>
    <script>
    function help(){
    window.open("http://www.w3schools.com/sql/default.asp",null,"height=500,width=700,scrollbars=1");}
    </script>
    <form method="post" action="<?php echo $PHP_SELF;?>" name="sqlform">
    <?php
    //Cookie to check for authorization to the site
    if($_COOKIE['cookie']=="CheckCookieForAuth")
    //These get the values of the textareas after the form has been submitted
    $sqlSELECT = $_POST["SELECT"];
    $sqlFROM = $_POST["FROM"];
    $sqlJOIN = $_POST["JOIN"];
    $sqlWHERE = $_POST["WHERE"];
    $sqlOTHER = $_POST["OTHER"];
    $sqlSELECTTYPE = $_POST["SELECTTYPE"];
    //This is the variable used to parse out my headers the user entered
    $sqlColNames = split('~',$sqlSELECT);
    //This converts the ~ separator to , so I can actually use it as part of my sql string
    $search = array('~');
    $replace = array(',');
    $mystring = $sqlSELECT;
    $sqlString = str_replace($search, $replace, $mystring);
    //These are the textareas and the drop down options that the end users has to create queries
    echo "<table border=0>";
    echo "<tr><td valign='top'>";
    echo "<B>SELECT TYPE</B> <BR><SELECT NAME=SELECTTYPE>
    <OPTION VALUE='SELECT' SELECTED>SELECT</OPTION>
    <OPTION VALUE='SELECT DISTINCT'>SELECT DISTINCT</OPTION>
    <OPTION VALUE='INSERT'>INSERT</OPTION>
    <OPTION VALUE='UPDATE'>UPDATE</OPTION>
    <OPTION VALUE='DELETE'>DELETE</OPTION>
    </SELECT>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=SELECT wrap=physical>$sqlSELECT</textarea>";
    echo "</td><td valign='top'>";
    echo "<img src='images/sqlC.jpg' width='25' height='25' onclick='colwin()'>";
    echo "</td></tr>";
    echo "<tr><td valign='top'>";
    echo "<b>FROM</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=FROM wrap=physical>$sqlFROM</textarea>";
    echo "</td><td valign='top'>";
    echo "<img src='images/sqlT.jpg' width='25' height='25' border=0 onclick='tabwin()'>";
    echo "</td></tr>";
    echo "<tr><td valign='top'>";
    echo "<b>JOIN</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=JOIN wrap=physical>$sqlJOIN</textarea>";
    echo "</td></tr>";
    echo "<tr><td valign='top'>";
    echo "<b>WHERE</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=WHERE wrap=physical>$sqlWHERE</textarea>";
    echo "</td></tr>";
    //This is where the end user would enter group by, having, order by, etc..
    echo "<tr><td valign='top'>";
    echo "<b>OTHER</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=OTHER wrap=physical>$sqlOTHER</textarea>";
    echo "</td></tr>";
    This is a run query icon and a help icon
    echo "<tr><td colspan=2 align=right>";
    echo "<img src='images/RunQuery.jpg' width='30' height='28' onclick='submit()'> <img src='images/qm.jpg' border=0 width='25' height='25' onclick='help()'>";
    echo "</td></tr></table>";
    echo "<br>";
    echo "<br>";
    //This is where I connect to my remote oracle database
         $conn=odbc_connect('ODBC_ConnectionName','USERNAME','PASSWORD');
    //This is the sql string created by the end users
         $sql="$sqlSELECTTYPE $sqlString FROM $sqlFROM $sqlJOIN $sqlWHERE $sqlOTHER";
    //This executes the connection string and the sql string
         $rs=odbc_exec($conn,$sql);
    //This will display the query or a message if the query is empty
         if($rs!=NULL){
         echo "<table border=1>";
         echo "<tr>";
    //This loops through the string array the end user enter the field name text area to get column headers
         for($i=0; $i<count($sqlColNames); $i++)
         echo "<td>";
         print_r($sqlColNames[$i]);
         echo "</td>";
         echo "</tr><tr>";
    //This actually fetchs the rows from the statement and then display the data based on the column names the end user speificed
         while (odbc_fetch_row($rs))
              for($i=0; $i<count($sqlColNames); $i++)
                   $results=odbc_result($rs,$sqlColNames[$i]);
                   echo "<td>$results</td>";
              echo "</tr>";
         odbc_close($conn);
         echo "</table>";}else{echo "Results will be displayed here";}
    echo "<br><br>";
    echo $sql;
    else
    echo "Not logged in";
    ?>
    </form>

    This looks more like a SQL question than a PHP issue. There are a couple of JOIN examples at http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#i2066611 that might you work through the problem.

  • Problems with BCS Queries Inconsistent Data

    Hi BI Experts,
    We recently had our BCS upgrade from 4.0 to 6.0 and BW upgrade from 3.5 to 7.0
    We have created some consolidated queries and we didnt change them to 7.0 they are still in 3.5 version. The problem is that we are getting some inconsistent data every time we ran those queries.
    The BWP is yet to under go upgrade process so we checked  the data in BWP (3.5) production and BWD (7.0) this tells us that the data in the tables are right.
    I ran the query in RSRT and gives inconsistent data.
    We are on the support pack 10 for BCS and
    support pack 14 for BI 7.0.

    Sorry guys....
    I want to correct one statement up there ...when I run my queries with through RSRT i dont get any inconsistent data ..the data comes exactly the way we want ...the problem is only through the BEx.
    Is it a upgrade bug or the support pack issue ..???
    Your suggestions will be appreciated with lots of points
    Thanks

  • Problem with sub queries

    Hi
    I have 3 tables like,
    LIST (ID NUMBER, NAME)
    LIST_VERSION (ID NUMBER, VER NUMBER, STATE_CODE number)
    STATE_CODES (CODE NUMBER, DESC VARCHAR2)
    LIST to LIST_VERSION is one to many relation. I have a query like this,
    SELECT LV.* from LIST_VERSION WHERE
    LV.VER = (SELECT MAX(LV1.VER) FROM LIST_VERSION LV1 WHERE
    LV1.ID = LV.ID)
    OR LV.VER = (SELECT MAX(LV2.VER) FROM LIST_VERSION LV2 WHERE
    LV2.ID = LV.ID and LV2.STATE_CODE=1)
    LIST to LIST_VERSION and LIST_VERSION to STATE_CODES table is defined
    in toplink mapping. To translate this into expression I have tried several possible combinations with out any luck. I was able to get the individual queries (the ones in OR) work, but not together. Here is what I did for individual queries
    ExpressionBuilder bldr = new ExpressionBuilder(ListVersion.class);
    ExpressionBuilder sub1 = new ExpressionBuilder ();
    ExpressionBuilder sub2 = new ExpressionBuilder ();
    ReportQuery subQ1 = new ReportQuery (ListVersion.class, sub1);
    ReportQuery subQ2 = new ReportQuery (ListVersion.class, sub2);
    subQ1.addMaximum ("listVer");
    subQ1.setSelectionCriteria (sub1.get ("list").get ("id").equal (bldr.get ("list").get("id")));
    subQ2.addMaximum ("listVer");
    subQ2.setSelectionCriteria (sub2.get ("list").get ("id").equal (bldr.get ("list").get("list")).and (sub2.get ("stateCode").get ("code").equal (1)));
    Expression exp1 = bldr.get("listVer").equal(subQ1);
    Expression exp2 = bldr.get("listVer").equal(subQ2);
    Each of the above expressions work fine independenty. However if I try to do some thing like,
    exp1.or(exp2) I get very strange SQL generated and get SQL exceptions in code. The SQL it generates is
    SELECT t0.ID, t0.VER, t0.STATE_CODE FROM LIST_VERSION t0 WHERE ((t0.VER = (SELECT MAX(t1.VER) FROM LIST t3, LIST t2, LIST_VERSION t1 WHERE ((t2.ID = t3.ID) AND ((t3.ID = t0.ID) AND (t2.ID = t1.ID))))) OR (t0.VER = (SELECT MAX(t4.VER) FROM LIST t5, LIST_VERSION t4, STATE_CODES t6 WHERE (((t5.ID = t3.ID) AND (t6.STATE_CODE = ?)) AND ((t6.STATE_CODE = t4.CODE) AND (t5.ID = t4.ID))))))
    The problem occurs because the t3.ID in the second sub query is not correct. it should be t0.ID, but I can't figureout why this is happening. Any help or suggessions to achieve my objective?
    Thanks
    Bhaskar

    Looking at your query that works at the bottom, I do not see any reason that you would need to include the Assignment table in the From list. Just use the same where clause in the form:
      Where project.resources_maximum
        > (Select Count(assignment.employee_ID)
           From assignment
           Where assignment.project_ID = project.project_ID
           group by assignment.project_ID  )

  • Installation Problems with Discoverer

    I have installed the 9iASR2 infrastrucure and the BI with default options on a w2k server three times now. Both are on the same machine but in different homes. After the install I cannot get to Discoverer. I can get to the EMWebsite, see the farm, and then look at my BI instance. In the listing of system components, the first item is 9iInst.ss01-as01.t3ss.com_Discoverer and in the status column is a question mark. The tool tip shows says "the status of component 9iInst.ss01-as01.t3ss.com_Discoverer is unknown. I have tried to start and restart all of the items in the EMWebsite with no change. i have searched Metalink with no success. Can someone please give me a clue as to what i am doing wrong? Thanks in advance.

    I had the same problem, and actually opened a tar with oracle ...
    They told me there was a but that even when discoverer was running, EM would display the stauts as "unknown" ... they told me there was nothing at the moment to fix this ....
    I have installed the 9iASR2 infrastrucure and the BI with default options on a w2k server three times now. Both are on the same machine but in different homes. After the install I cannot get to Discoverer. I can get to the EMWebsite, see the farm, and then look at my BI instance. In the listing of system components, the first item is 9iInst.ss01-as01.t3ss.com_Discoverer and in the status column is a question mark. The tool tip shows says "the status of component 9iInst.ss01-as01.t3ss.com_Discoverer is unknown. I have tried to start and restart all of the items in the EMWebsite with no change. i have searched Metalink with no success. Can someone please give me a clue as to what i am doing wrong? Thanks in advance.

  • Strange Problems with Discoverer Plus 10g

    Hello All -
    I'm working an exercise to bring an application online which uses Discoverer Plus 10g as its client. This application is located in an area that I don't have access to, so the symptoms I'll describe have been reported to me by users.
    1) When users log into Discoverer Plus and it launches, it does so with the iconic menu buttons (located below the pull-down menus) disabled and grayed-out. The users are forced to do all operations using the pull-down menus. This is a problem that is consistent across different PCs.
    2) When users do File....Save As.... the "Save Workbook to Database" window opens and the user is unable to modify the filename in the "New name" text field. If the user toggles the "View:" setting at the top of the window, they can then change the filename. This problem has only been reported by 2 users, but it's happening for them consistently.
    3) When a user creates a new report using File....New... the Workbook Wizard opens and all is normal until the "Workbook Wizard - Step 2 of 5: Select Items" page appears. On the items tab, the user activates the pull-down list to select the business area they want to use, and the business area name disappears when the users mouses-over it. So the user must click on the blank business area name to continue. This is a problem that is consistent across different PCs.
    A number of the users' PCs have two Java versions installed on them like this:
    Platform     Product
    1.4     1.5.0_14
    1.5     1.4.2_16
    I had them make sure that 1.5.0_14 is the only one enabled, but that did not remedy any of the above problems.
    At this point I don't know what to try next.
    All help is greatly appreciated.
    Patrick

    Try the 1.4.2_06 java version
    I suggest you remove other java version and stay with just one.
    I do not remember but from some point the java version will use the higher there is and java 1.5 from my experience
    is not working with the discoverer so well.
    Tamir

  • Problems with dynasight queries (Essbase goes fast)

    Hi, we use dynasight tool to retrieve the data. The time of queries shown in app. window are fast, but we think dynaserver has problems, maybe in sharing the cache memory although this is up to 2 GB and essbase doesn't take more than 600 MbThanks a lot

    Hello,in principle, the performance of dynaSight should be more or less identical to the performance you get from an equivalent query from within the Excel Add-In for example. Therefore, the performance problem is very likely due to the specific design of the dynaSight documents/screens.Please check the following:- hierarchy objects configuration:is 'request other levels when expanded' used for the vertical and horizontal hierarchy objects? Depending on the use and type of query this feature may speed up performance significantly.- are you using individual selections?If yes: are you using more than 99 members in an individual member selection (this is the limit on the Essbase Side: if you exceed that limit, dynaSight will query the complete hierarchy and filter out the selected members)- optimize the screens by for example consolidating multiple queries / database calls into one query / database call.=> these are just a few suggestions to look into. In general, I would strongly suggest to contact [email protected] and provide them with some application components and trace and log files so the design issues can be analysed and identified more specifically.Best RegardsAndreas [email protected] of Competence Center

  • Problem with some queries after migration from MS Access

    Hi everyone!
    We've just finished a migration from a MS Access database and we notice some errors when running some queries like :
    Query1:
    SELECT A.field1, A.field2, B.field1 as FieldTmp
    FROM A,B
    where (B.field1 <=10);
    Query2:
    SELECT Query1.field1, Query1.field2, Query1.FieldTmp
    FROM Query1 LEFT JOIN Table3
    ON (Table3.field1 = Query1.Field2) AND
    (Table3.field5 = Query1.FieldTmp)
    WHERE ((Table3.field5) Is Null)
    ORDER BY Query1.field1, Query1.FieldTmp;
    The Query1 runs as expected, but when I try to run the Query2 I got a ORA-00904 error message. If I remove the (Table3.field5 = Query1.FieldTmp) statement or modify to compare with another field (as instance, field2) everything goes fine.
    If I modify the first query to a make-table query, the Query2 request runs as desired too.
    Is there anything that we can do to keep the queries statement as it is when using the MS Access DB?
    Thanks in advance,
    Elaine Viel Denadai

    Hi Turloch! Thanks for your help!
    Those SQL Statements were extracted from the MS Access application that we will continue to use to access the data , now on an Oracle Database.
    I don't know what I can do to make this kind of statements works as it is on Access database. The first query, that I called Query1 works fine on Oracle, I just mentioned it because the 2nd Query , named Query2, use it.
    I'm not able to understand why when I change the 1st. query to a "make-table" query the Query2 works as desired, but if I keep the Query1 and Query2 as it is on the MS Access Application I got the ODBC error message and the ORA-00904 error message , related (I think!) to the FieldTmp field used on the LEFT JOIN statement (AND).
    As I told before, if I change the AND clause to compare to another field, as instance, field1 :
    FROM Query1 LEFT JOIN Table3
    ON (Table3.field1=Query1.Field2) AND
    (Table3.field5 = Query1.Field1)
    it works.
    Please, is there anything that I can do to keep the MS Access Application unchanged?
    Oracle = 8.1.6
    Oracle ODBC Driver = 8.1.6.4
    Oracle Migration Workbench = 1.3.1
    Thanks in advance,
    Elaine Viel Denadai

  • Problem with select queries

    Dear Friends,
    I have written the below select queries to get the shipment details for a given date range.
    select vbeln lddat
      into table itab
      from likp
      where lddat in l_r_date2 .
      if not it_ldt[] is initial.
        select fknum fkpos rebel
        into table jtab
        from vfkn
        for all entries in itab
        where
        rebel = itab-vbeln.
      endif.
    First query is giving 82000 entries and second query is giving approx 60000 from the table VFKN( total entries in this table are 8 lakhs).
    Here the problem is second select query(for all entries select query) is taking a time of 3 to 4 hours.
    So please suggest me how can i reduce the time.
    Thanks and Regards

    Hi,
    Use FREE or PACKAGE size.
    Some steps that might make FOR ALL ENTRIES more efficient:
    Removing duplicates from the driver table Sorting the driver table
    If possible, convert the data in the driver table to ranges so a BETWEEN statement is used instead of and OR statement:
    FOR ALL ENTRIES IN i_tab
                      WHERE mykey >= i_tab-low and
                 mykey <= i_tab-high.
    Regards
    Krishna

  • Problem with Discoverer Workbook in Purchasing Intelligence menu

    Hello
    We have implemented out-of-the-box Purchasing Intelligence (PI) that comes with the Oracle e-Business Suite. There is only one Discoverer Workbook - 'Contract Savings Analysis' workbook which cannot be accessed from the Applications.
    This workbook works fine in standalone mode from Discoverer Plus or Desktop. However, whenever trying to access this workbook from the Applications PI menu, Discoverer is launched but the browser hangs with the message 'Loading workbook'.
    We checked the following:
    1. Menu
    2. Sub-menu
    3. Function
    4. Parameter (correctly set to workbook = POASVNGS)
    This is not one of the EDW Discoverer Workbooks but the single PI Discoverer Workbook.
    I was wondering if anybody in this forum has faced this issue before? Your suggestions or comments would be greatly appreciated.
    Thanks
    Sanjib Manna
    IBM Business Consulting Services

    The note provided by Luis will fix the issue.
    Excel 2000 seems not supported for a long time.
    As suggestion to avoid new issues, (specially performance issue), update the SAPGUI and BI Addons to latest version.
    Thanks
    John

  • Roll-Up/Drill-Down Problem with Discoverer

    Hi,
    I am trying to produce some summary data, but am not exactly sure how to proceed.
    Specifically, I have a table containing attendance data for a number of weeks. Part of table is shown below. 1 indicates attendance and 0 indicates absense.
    |-------------------------------------------------|
    | Attendance ID | Wk_1 | Wk_2 | Wk_3 | Wk_4 | ... |
    |-------------------------------------------|-----|
    | 0001 | 1 | 0 | 1 | 1 | ... |
    | 0002 | 1 | 0 | 0 | 0 | ... |
    |-------------------------------------------------|
    Each student has a number of attendance_ids, each one represents a particular subject they study.
    For example:
    |------------------------------------------------|
    | Student Name | Attend ID | Subject | Attendance|
    |------------------------------------------------|
    | Amberley | 0001 | IS3004 | 50 |
    | | 0002 | MM3003 | 75 |
    | | 0003 | PR3003 | 60 |
    |------------------------------------------------|
    In Discoverer, to create a percentage attendance, I add up all the columns and then divide by the number of weeks.
    However, what I would really like to do, is to be able to roll this data up for summary based work and then to be able to drill down as necessary.
    Looking at the Video Store Tutorial, Stores were rolled up into Cities and Regionsc, can anyone give me some pointers on how I could roll up my data?
    Thanks,
    Eddie

    Hi Eddie,
    Try looking up hierarchies in the Administrator Guide.
    However, I'm afraid you'll have to pivot your attendance table in order to create a hierarchy.
    Example:
    Now:
    att_id week_1 week_2 week_3 ...
    1001 0 1 1 1
    1002 1 1 0 1
    1003 1 1 1 0
    Needed for hierarchy:
    att_id week_nr att_boolean
    1001 1 0
    1001 2 1
    1001 3 1
    1002 1 1
    Look up "pivoting scenarios" in the data warehousing guide (OTN documentation) on how to do this (preferably a view on the original table, if necessary materialized view).
    Then add additional time columns (or, better yet, create a time hierarchy table) with appropriate date hierarchy values, ie quarter and year. A weekbased hierarchy is tricky though, because weeks can "break" from one month/quarter/year to the other. So, figure this out carefully before you start creating you're time hierarchy.
    Regards,
    Sabine

  • Problem with hierarchical queries

    Hi,
    I implemented (thx to jarola) sucessfully a report using a hierarchical view.
    It is nearly the same as in Tyler Muths blog: -http://tylermuth.wordpress.com/2009/02/26/hierarchical-query-to-unordered-list/-
    -select (level*20)-20 the_level ,(level*10)-10 the_level2, machine_no
    - parent_id, item_id,description
    -from machine_list
    -where machine_no = 101
    -and project_id = 122
    - connect by prior item_id = parent_id
    - start with parent_id is null
    This works good, as long as there is just one project/machine in the table.
    If I have 2 machines in the table, it does not work in the report anymore, all entries are shown, although I check for the right machine_number and project_number in the query :-(
    Any suggestions?
    BR
    Lena

    Hi Joel
    Just for reference, to write the code tags in posts without a space, you can use noformat tags on either side like this (let's see if I can manage this!)...
    <pre>{noformat }{noformat }</pre>
    Edited by: Munky on Apr 27, 2011 10:03 AM
    Edited by: Munky on Apr 27, 2011 10:03 AM
    Edited by: Munky on Apr 27, 2011 10:03 AM
    Edited by: Munky on Apr 27, 2011 10:04 AM
    Edited by: Munky on Apr 27, 2011 10:04 AM
    Edited by: Munky on Apr 27, 2011 10:05 AM - sod it! had to add spaces to the noformat tags!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problems with User Queries

    Hi everybody,
    i recieved an error while try to run a user query in Business One which works fine in SQL Studio.
    DECLARE @PROJECT as nvarchar(128)
    SET @PROJECT = '[%0]'
    select query2.docnum, query2.DocStatus, query2.CardCode, query2.CardName, query2.DocDate, query2.DocDueDate, query2.DocTotal, query2.DocTotalSy, query2.CurSource, query1.[Total Sum]
    from
    (select sum(DocTotal) as 'Total Sum' from OPOR where project = @PROJECT ) as query1,
    (select bx.DocNum, bx.DocStatus, bx.CardCode, bx.CardName, bx.DocDate, bx.DocDueDate, bx.DocTotal, bx.DocTotalSy, bx.CurSource from OPOR bx where bx.Project = @PROJECT) as query2
    The Query runs fine if i presect the Projectnumber like SET @PROJECT = '12345678'. But not if the user can choose the project number.
    I tried a lot of variations of that code. But nothing i won't work. Have anybody an Idea what's the problem is?
    Thanks and best Regards,
    Sebastian

    Try this:
    DECLARE @PROJECT as nvarchar(128)
    SET @PROJECT /* select 1 from opor t where t.project */='[%0]'
    select query2.docnum, query2.DocStatus, query2.CardCode, query2.CardName,
    query2.DocDate, query2.DocDueDate, query2.DocTotal, query2.DocTotalSy, query2.CurSource, query1.[Total Sum]
    from
    (select sum(DocTotal) as 'Total Sum' from OPOR where project = @PROJECT ) as query1,
    (select bx.DocNum, bx.DocStatus, bx.CardCode, bx.CardName, bx.DocDate, bx.DocDueDate, bx.DocTotal, bx.DocTotalSy, bx.CurSource from OPOR bx where bx.Project = @PROJECT) as query2

  • Where clause problem with sub-queries in forms 6i

    where is the best place to put a sub query?? I have been using the set block property, however when running a sub query an alternative method must be used. what are some other options?? I have tried to have the query directly in the data block property palette but to no avail...
    There are 2 tables project and assignment
    maximum resources cannot be exceeded therefore a count of employees
    on the assignment table establishes that there are open spaces on the project.
    This code Here is my code for my where clause on the data block
    project.resources_maximum >
    (Select Count(assignment.employee_ID)
    From assignment
    Where assignment.project_ID = project.project_ID
    group by assignment.project_ID
    and project.end_date>sysdate;
    I was reading that the project table must be defined in the from clause
    to have the query go row by row, otherwise multiple rows are returned
    however I cannot define the project in the from,
    could this be why this doesn't work???
    original SQL that does work
    Need to migrate this to forms
    Select project.project_ID
    from project
    Where project.resources_maximum >
    (Select Count(assignment.employee_ID)
    From assignment
    Where assignment.project_ID = project.project_ID
    group by assignment.project_ID
    and project.end_date>sysdate;

    Looking at your query that works at the bottom, I do not see any reason that you would need to include the Assignment table in the From list. Just use the same where clause in the form:
      Where project.resources_maximum
        > (Select Count(assignment.employee_ID)
           From assignment
           Where assignment.project_ID = project.project_ID
           group by assignment.project_ID  )

Maybe you are looking for

  • Need help in grouping data Value.

    Hi Techies, I have a requirement where i need to group the rating acording to issuer country and show the aggegated data value in the report. Country Rating Value US A 324 US AA 43 Europe C 8 Canada A 34 Here in the below tables we are showing aggega

  • How to render image in tree control without embed it

    Hello frndz i am working on tree control and want to show imagein its node through xml list collection.i have searched a lot for this but in every example with tree control images are embeded.i dont want to hardcode the image.Need to make the image c

  • My playlist does not appear after syncing ipod

    My playlist is not syncing to my ipod...what should i do?

  • MI Server Installation Problem while installing MAX DB

    Dear All, As a part of installing MI Server, I am getting the following error while installing MAXDB. The dbmcli call for action ACTIVATE failed. -24988,ERR_SQL: Sql error -2014,Identifier too long Could anyone of you let me know the solution if you

  • Relaunch & Optimize program removed images and catalog

    I had just imported a about 500 images. The response to commands was very slow so decided to implement the Relaunch and Optimize program. Suddenly the catalog and images disappeared. As I relaunch Lightroom, I noticed all but one catalog had disappea