Sub query results use in main query.

I need to query a specific parameter in one table called parameter_id which will return a list of location id's.  Utilizing those i then need to query another table for the max(date_time) values in another table.
Select LOCATION_ID FROM TABLE1
WHERE PARAMETER_ID='ELEV_POOL;
SELECT
TABLE1.PARAMETER_ID,
TABLE1.CWMS_TS_ID,
TABLE2.VALUE,
TABLE1.BASE_LOCATION_ID,
TABLE2.DATE_TIME,
FROM TABLE2
INNER JOIN
TABLE1
ON
TABLE1.CWMS_TS_ID=TABLE2.CWMS_TS_ID
WHERE
TABLE1.CWMS_TS_ID LIKE '%-REV'
AND TABLE2.UNIT_ID=('FT')
AND TABLE2.VALUE IS NOT NULL
AND (TABLE2.CWMS_TS_ID,TABLE2.DATE_TIME)IN
(SELECT CWMS_TS_ID, MAX(DATE_TIME)
FROM TABLE2
GROUP BY TABLE2.CWMS_TS_ID)

this is table 1:
CWMS_TS_ID
UNIT_ID
ABSTRACT_PARAM_ID
BASE_LOCATION_ID
SUB_LOCATION_ID
LOCATION_ID
BASE_PARAMETER_ID
SUB_PARAMETER_ID
PARAMETER_ID
PARAMETER_TYPE_ID
INTERVAL_ID
DURATION_ID
INTERVAL
WhitleyvilleTN-JNCT1-JenningsCr.Precip-Bucket.Inst.1Hour.0.celrndcp-rev
mm
Length
WhitleyvilleTN
JNCT1-JenningsCr
WhitleyvilleTN-JNCT1-JenningsCr
Precip
Bucket
Precip-Bucket
Inst
1Hour
0
60
JohnsonvilleTN-NJNT1-TennesseeR.Elev.Inst.1Day.0.tvaknoxville-rev
m
Length
JohnsonvilleTN
NJNT1-TennesseeR
JohnsonvilleTN-NJNT1-TennesseeR
Elev
Elev
Inst
1Day
0
1440
Kentucky-KYDK2-Tailwater.Elev.Inst.1Day.0.tvaknoxville-rev
m
Length
Kentucky
KYDK2-Tailwater
Kentucky-KYDK2-Tailwater
Elev
Elev
Inst
1Day
0
1440
KingstonSprngsTN-KINT1-HarpethR.Precip-Bucket.Inst.1Hour.0.celrndcp-rev
mm
Length
KingstonSprngsTN
KINT1-HarpethR
KingstonSprngsTN-KINT1-HarpethR
Precip
Bucket
Precip-Bucket
Inst
1Hour
0
60
this is table 2:
TS_CODE
VERSION_DATE
DATA_ENTRY_DATE
DATE_TIME
VALUE
UNIT_ID
CWMS_TS_ID
QUALITY_CODE
START_DATE
END_DATE
210010
1111-11-11:00:00:00
29-JUL-10 03.37.44.613000000 PM
2000-01-13:15:00:00
207.74660232543903
cm
AlbanyKY-ALBK2.Precip-Bucket.Inst.1Hour.0.celrndcp-raw
0
1700-01-01:00:00:00
2002-01-01:00:00:00
210010
1111-11-11:00:00:00
29-JUL-10 03.37.44.613000000 PM
2000-01-13:15:00:00
6.815833409627264
ft
AlbanyKY-ALBK2.Precip-Bucket.Inst.1Hour.0.celrndcp-raw
0
1700-01-01:00:00:00
2002-01-01:00:00:00
210010
1111-11-11:00:00:00
29-JUL-10 03.37.44.613000000 PM
2000-01-13:15:00:00
81.79000091552717
in
AlbanyKY-ALBK2.Precip-Bucket.Inst.1Hour.0.celrndcp-raw
0
1700-01-01:00:00:00
2002-01-01:00:00:00
210010
1111-11-11:00:00:00
29-JUL-10 03.37.44.613000000 PM
2000-01-13:15:00:00
0.00207746602325439
km
AlbanyKY-ALBK2.Precip-Bucket.Inst.1Hour.0.celrndcp-raw
0
1700-01-01:00:00:00
2002-01-01:00:00:00

Similar Messages

  • How can I pass/add these results in my Main query's column

    Hello Experts
    I’m working on a subquery. My subquery works fine and give the results what I need. But how can I pass/add these results in my Main query’s column ‘MGRNAME’. Here is my query
    select pc.c_id "Project ID",
    cn.c_id "Client ID", cn.c_last "Last Name", cn.c_first "First Name",
    pj.mgr_id "Manager ID", pj.project_name "Project", MGRNAME
    from project_consultant pc
    join consultant cn
    on (pc.c_id = cn.c_id)
    join project pj
    on (pc.p_id = pj.p_id)
    where lower(cn.c_last) = 'myers'
    and MGRNAME in
    ( select concat (substr(c_last,1,20),
    substr(c_first,1,20))
    as MGRNAME from consultant
    where c_id in (102, 103)
    When I run the above query I got error.
    Thanks a lot on advance

    I’ve join three tables to get the information about I need. I got everything working expert one part. The subquery
    ( select concat (substr(c_last,1,20),
    substr(c_first,1,20))
    as MGRNAME from consultant
    where c_id in (102, 103)
    Gives me the names of employees I need. The output comes 2 names. I’m trying to add these 2 names in my main query and show the results but I got the following error
    Error at Command Line:11 Column:4
    Error report:
    SQL Error: ORA-00904: "MGRNAME": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    *Cause:   
    I can understand there is something wrong with MGRNAME field but not sure what it is. Can somebody point it out?
    Once again this is main query with single sub query
    select pc.c_id "Project ID",
    cn.c_id "Client ID", cn.c_last "Last Name", cn.c_first "First Name",
    pj.mgr_id "Manager ID", pj.project_name "Project",
    MGRNAME
    from project_consultant pc
    join consultant cn
    on (pc.c_id = cn.c_id)
    join project pj
    on (pc.p_id = pj.p_id)
    where lower(cn.c_last) = 'myers'
    and MGRNAME in
    ( select concat (substr(c_last,1,20),
    substr(c_first,1,20))
    as MGRNAME from consultant
    where c_id in (102, 103)
    Hope it helps

  • How to use query-result as a new query-fiter

    HI, All
    Is it possible to execute sub-query filtererd by the pre-query-reslted lists ?
    As far as I investigated, only way to do is that I combine two suject-areas by using set operations like "Union" or around.
    But in this way, there is an impractical restriction to define these datatype and column in common. (namely, "Union" conditions)
    I just want to query filtered by ex-query-results at anytime; for example, I extract a customer lists by one query and use various analysis in the group of customer list.
    Please give me some advise.
    Regards

    First create a Request with your FilterQuerey. Secund Create a Request und create a Filter. Under Advanced you will find the path to the first Requst. Than you can select the columns.
    Thats it :-)
    Stefan

  • How to merge 3 different query results using full outer join?

     Hi all This is my my query for 2 results
    with t1 as (
    select trans.crAcc_id,trans.cr_amt,row_number() over (order by trans.head_id) rn from Acttrans trans,
     Acttranhead head where trans.head_id in(select link_id from acttrans where head_id=12) and trans.crAcc_id!=0
     and head.head_id=trans.head_id
    t2 as (
    select trans.drAcc_id,trans.dr_amt,head.[Vouc_No],head.[Vouc_Date] ,head.[Check_No],head.[Check_Date],head.[stat],row_number() over (order by trans.head_id) rn from Acttrans trans,
     Acttranhead head where trans.head_id=12 and trans.drAcc_id!=0
     and head.head_id=trans.head_id
     select t1.crAcc_id, t1.cr_amt,t2.[Vouc_No],t2.[Vouc_Date] ,t2.[Check_No],t2.[Check_Date],t2.[stat],t2.drAcc_id,t2.dr_amt from t1
      full outer join t2 on t1.rn = t2.rn
    Query 3: SELECT [CrAcc_Id]  FROM [KSSDATA].[dbo].[ActTrans] where head_id=12 and crAcc_id!=0
    and i want to add Query3 result to the ABOVE RESULT but i am unable add third result using full outer join
    Thanks
    Balu D

    >>>but i am unable add third result using full outer join
    Do you get the error or wrong result?
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Errors with querying a query table using non-QoQ query and QoQ query

    HELP ! ! !  Going into testing soon. I need this to work to get correct report results ! ! ! !
    My issue seems similar to the one just answered about Query of Queries RunTime Error
    and the reply from lawhite01 caught my eye.
    This is a 2 parter. The second part is the QoQ part, but the 1st part has a line in the query that is similar to the QoQ one and it uses the same data. Part 1 also throws an error.
    PART # 1.
    I'm trying to use a query table created through QueryNew and then query it.
    I need multiple columns in the query table I create:
    <cfscript>
            tot_AllCurrentDraftListing = QueryNew("AnnounceNum, JP_PDLoc, JP_JS_Title, JP_JS, JP_KW_1, JP_JobTitle, JP_Open, JP_Close, JP_CloseType, JP_CloseName, JP_PosNeed, JP_DirectHire, JP_Desc, JP_Draft, JP_Archived, JP_State, JP_AreaName, JP_AreaID, JP_AreaAlias, JP_Fac_SU, JP_Fac_Facility, JP_FAC_ID, JP_Grade1, JP_sal_low1, JP_sal_high1, JP_Grade2, JP_sal_low2, JP_sal_high2, JP_Grade3, JP_sal_low3, JP_sal_high3, JP_Grade4, JP_sal_low4, JP_sal_high4, JP_Grade5, JP_sal_low5, JP_sal_high5, JP_Posted, JP_TypeHire, JP_HRemail");
        </cfscript>
    Then I populate all the cells of the query table.
    Then I set up to use the created query table.
    I do this first:
        <cfquery name="qAltPostID" datasource="#at_datasource#">
             SELECT AltPoster, fk_Job_AnnounceNum
             from JOB_JPContacts
             Where AltJPContactType = 'AltPosterID'
             and AltPoster = '#session.IHSUID#'
             </cfquery>
    Then, in my first query using the created query, I expect to need to choose from multiple values, so I'm using this line in the query (this is NOT a QoQ query):
                and AnnounceNum IN (<cfqueryparam cfsqltype="CF_SQL_varchar" value="#ValueList(qAltPostID.fk_Job_AnnounceNum)#">)
    I've also tried:
                   and AnnounceNum IN (#ValueList(qAltPostID.fk_Job_AnnounceNum)#)   
    and:
                   and JOB_AnnounceNum IN
                    SELECT fk_Job_AnnounceNum
                    from JOB_JPContacts
                    Where AltJPContactType = 'AltPosterID'
                    and AltPoster = '#session.IHSUID#'
    ERROR is: one record should return. I get 0.
    PART # 2: Here's the QoQ part.
    I get the error:
    Query Of Queries runtime error.
    Comparison exception while executing IN.
    Unsupported Type Comparison Exception: The IN operator does not support comparison between the following types:
    Left hand side expression type = "LONG".
    Right hand side expression type = "STRING".
    A tutorial I found gave an example using only one column for this part of the fix:
         tot_AllCurrentDraftListing = QueryNew("AnnounceNum", "CF_SQL_VARCHAR")
    How would I set up the query with the datatype when I'm using multiple columns:
    <cfscript>
            tot_AllCurrentDraftListing = QueryNew("AnnounceNum, JP_PDLoc, JP_JS_Title, JP_JS, JP_KW_1, JP_JobTitle, JP_Open, JP_Close, JP_CloseType, JP_CloseName, JP_PosNeed, JP_DirectHire, JP_Desc, JP_Draft, JP_Archived, JP_State, JP_AreaName, JP_AreaID, JP_AreaAlias, JP_Fac_SU, JP_Fac_Facility, JP_FAC_ID, JP_Grade1, JP_sal_low1, JP_sal_high1, JP_Grade2, JP_sal_low2, JP_sal_high2, JP_Grade3, JP_sal_low3, JP_sal_high3, JP_Grade4, JP_sal_low4, JP_sal_high4, JP_Grade5, JP_sal_low5, JP_sal_high5, JP_Posted, JP_TypeHire, JP_HRemail");
        </cfscript>
    I used this code after all the cells contained values and before running my QoQ query:
            <cfloop index="intID" from="1" to="#tot_AllCurrentDraftListing.recordcount#" step="1">
                <cfset tot_AllCurrentDraftListing["AnnounceNum"] [intID] = JavaCast("string", intID) />
            </cfloop>
              Is that correct?
    Thanks.
    Whoever can help me with this should be awarded extra points ! ! ! !

                and AnnounceNum IN (<cfqueryparam cfsqltype="CF_SQL_varchar" value="#ValueList(qAltPostID.fk_Job_AnnounceNum)#">)
    If you're passing a list as a param, you need to tell <cfqueryparam> it's a list.  Read:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_18.html#1102474
    ERROR is: one record should return. I get 0.
    It's a bit hard to comment on this sort of thing without knowing the data involved.
    A tutorial I found gave an example using only one column for this part of the fix:     tot_AllCurrentDraftListing = QueryNew("AnnounceNum", "CF_SQL_VARCHAR")
    How would I set up the query with the datatype when I'm using multiple columns:
    Again, this is a matter of reading the relevant docs:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_m-r_19.html#292759
    As a general rule, if you're having trouble with the syntax of a CFML statement, look it up in the docs.
    Adam

  • How to design a query without using Net Weaver Query Designer

    Does anyone know if any alternative way to <b>design an query without using Net weaver GUI</b>? in order to reduce the time consuming, I am wondering if there have any method which can define/modify a stack of cells, characteristics and structures without work through the GUI.
    Deeply thank for any of your advices.

    Can you give an example?
    Just from what you write, I would assume that you talk about something like a mass-property-changer. As far as I know the BEx this is not really possible, but what I do normally is building one query and then either using query-views (saving more or less the navigation state) or by copying and changing the properties of the few characteristics and key figures.
    But without a specific example it's difficult to exactly understand what you exactly need.
    Mario

  • How to Prioritize the Query Result Using Analytical Functions

    hi
    Edited by: prakash on May 20, 2013 1:42 AM

    Use ROW_NUMBER
    SQL> select PRVDR_LCTN_X_SPCLTY_SID,PRVDR_LCTN_IID,PRVDR_TYPE_X_SPCLTY_SID,STATUS_CID
      2  from
      3  (
      4    select t.*,
      5      row_number() over(partition by PRVDR_TYPE_X_SPCLTY_SID
      6                        order by STATUS_CID) rn
      7    from your_table t
      8  )
      9  where rn = 1;
    PRVDR_LCTN_X_SPCLTY_SID PRVDR_LCTN_IID PRVDR_TYPE_X_SPCLTY_SID STATUS_CID
                   75292110       10153920                75004770          1
                   75291888       10153920                75004884          2
                   75292112       10153920                75004916          1
                   75292117       10153920                75004974          1

  • HOWTO: Writing Out XML Query Results of Any Size in Java with XML SQL Utility

    A customer mailed me asking for an example of how to use our XML SQL Utility to write out query results for tons of query result rows.
    With tons of data, the getXMLDOM() and getXMLString() methods are not really appropriate due to the size.
    The XML SQL Utility offers a getXMLSAX() method that streams SAX2 events to report the data being queried. This is the approach we can use to handle data of any size.
    It dawned on me today that by putting together the XML SQL Utilities getXMLSAX() routine, and the oracle.xml.parser.v2.XSLSAXPrintDriver SAX2 ContentHandler, we can effectively stream out data of any length to an appropriate writer.
    Here's a code example to get the point across:
    package test;
    import java.io.BufferedOutputStream;
    import java.io.PrintWriter;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.util.Properties;
    import javax.xml.transform.OutputKeys;
    import oracle.jdbc.OracleDriver;
    import oracle.xml.parser.v2.XSLException;
    import oracle.xml.parser.v2.XSLOutput;
    import oracle.xml.parser.v2.XSLSAXPrintDriver;
    import oracle.xml.sql.query.OracleXMLQuery;
    public class Example  {
      private static final String QUERY = "select * from emp";
      public static void main(String[] args) throws Throwable  {
          Connection conn = getConnection();
          OracleXMLQuery q = new OracleXMLQuery(getConnection(),QUERY);
          // Any printwriter will do. Here's we're output to standard out.
          PrintWriter output = new PrintWriter(new BufferedOutputStream(System.out));
          // This is a SAX2 Content Handler used by the Oracle XSLT Engine
          // to serialize a stream of sax2 events as an XML document
          // We'll use it to serialize the sax2 events from the XML SQL Utility
          // out as an XML document.
          XSLSAXPrintDriver ch = new XSLSAXPrintDriver(output, outputOptions());  
          // This asks XML SQL Utility to fire sax events for the data
          // being fetched instead of creating DOM nodes or returning text.
          // By using the XSLSAXPrintDriver content handler, these events
          // get handled by writing them directly to the output stream
          q.getXMLSAX(ch);
          ch.flush();
          q.close();
          conn.close();     
      private static XSLOutput outputOptions() throws XSLException {
        XSLOutput x = new XSLOutput();
        Properties props = new Properties();
        props.put(OutputKeys.METHOD,"xml");
        props.put(OutputKeys.INDENT,"yes");  // Set to "no" for non-indented
        x.setProps(props);
        return x;
      public static Connection getConnection() throws SQLException {
        String username = "scott";
        String password = "tiger";
        String thinConn = "jdbc:oracle:thin:@localhost:1521:ORCL";
        Driver d = new OracleDriver();
        return DriverManager.getConnection(thinConn,username,password);
    }

    Hi Uber,
    This is a known issue that error occurs when running report "Count of instances of specific software registered with Add or Remove Programs" due to non-printable characters for XML. Based on internal research, the hotfix for this issue will be
    included in the System Center 2012 Configuration Manager Service Pack 1.
    As a workaround, you can remove the nonprintable character populated into the report parameter by referring to the following KB article:
    http://support.microsoft.com/KB/914159
    Hope this helps.
    Regards,
    Mike Yin
    Mike Yin
    TechNet Community Support

  • How can I use a single query panel with two view criteria?

    Hi all,
    I have a requirement to allow users to change the "display mode" on a search results tree table for an advanced search page. What this will do is change the structure of how the data is laid out. In one case the tree table is 3 levels deep, in the other case it's only 2 with different data being at the root node.
    What I've done so far:
    1) I exposed the data relationship for these two ways of viewing the data in the application module's data model.
    2)  I created a view criteria in the two view objects that are at the root of the relationships, where (for simplicity sake) I'm only comparing a single field.
    This is in one view object:
    <ViewCriteria
        Name="PartsVOCriteria"
        ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.PartsVO"
        Conjunction="AND">
        <Properties>... </Properties>
        <ViewCriteriaRow
          Name="vcrow23"
          UpperColumns="1">
          <ViewCriteriaItem
            Name="PartDiscrepantItemsWithIRVO"
            ViewAttribute="PartDiscrepantItemsWithIRVO"
            Operator="EXISTS"
            Conjunction="AND"
            IsNestedCriteria="true"
            Required="Optional">
            <ViewCriteria
              Name="PartDiscrepantItemsWithIRVONestedCriteria"
              ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.PartDiscrepantItemsWithIRVO"
              Conjunction="AND">
              <ViewCriteriaRow
                Name="vcrow26"
                UpperColumns="1">
                <ViewCriteriaItem
                  Name="InspectionRecordNumber"
                  ViewAttribute="InspectionRecordNumber"
                  Operator="="
                  Conjunction="AND"
                  Value=""
                  Required="Optional"/>
              </ViewCriteriaRow>
            </ViewCriteria>
          </ViewCriteriaItem>
        </ViewCriteriaRow>
      </ViewCriteria>
    and this is in the other view object:
    <ViewCriteria
          Name="IRSearchCriteria"
          ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.InspectionRecordVO"
          Conjunction="AND">
          <Properties>... </Properties>
          <ViewCriteriaRow
             Name="vcrow7"
             UpperColumns="1">
             <ViewCriteriaItem
                Name="InspectionRecordNumber"
                ViewAttribute="InspectionRecordNumber"
                Operator="="
                Conjunction="AND"
                Required="Optional"/>
          </ViewCriteriaRow>
       </ViewCriteria>
    3) I had a query panel and tree table auto-generated by dragging the data control for ONE of the view object data relationship that's exposed in the app module. Then I created a second query panel and tree table the same way but using the data control for the other. I'm hiding one of the query panels permanently and toggling the visibility of the tree tables based on the display mode the user chooses. Both tables have separate bindings and iterators.
    This is a portion of the page definition:
    <executables>
        <variableIterator id="variables"/>
        <searchRegion Criteria="IRSearchCriteria"
                      Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      Binds="InspectionRecordVOIterator"
                      id="IRSearchCriteriaQuery"/>
        <iterator Binds="InspectionRecordVO" RangeSize="25"
                  DataControl="QARS_AppModuleDataControl"
                  id="InspectionRecordVOIterator" ChangeEventPolicy="ppr"/>
        <iterator Binds="Root.QARS_AppModule.PartsVO1"
                  DataControl="QarsMasterAppModuleDataControl" RangeSize="25"
                  id="PartsVO1Iterator"/>
        <searchRegion Criteria="PartsVOCriteria"
                      Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      Binds="PartsVO1Iterator" id="PartsVOCriteriaQuery"/>
      </executables>
    4) I've created a custom queryListener to delegate the query event.
    This is in my advanced search jsp page:
    <af:query id="qryId1" headerText="Search" disclosed="true"
                      value="#{bindings.IRSearchCriteriaQuery.queryDescriptor}"
                      model="#{bindings.IRSearchCriteriaQuery.queryModel}"
                      queryListener="#{pageFlowScope.SearchBean.doSearch}"
                      queryOperationListener="#{bindings.IRSearchCriteriaQuery.processQueryOperation}"
                      resultComponentId="::resId2" maxColumns="1"
                      displayMode="compact" type="stretch"/>
    This is in my backing bean:
    public void doSearch(QueryEvent queryEvent) {
          String bindingName = flag
             ? "#{bindings.IRSearchCriteriaQuery.processQuery}"
             : "#{bindings.PartsVOCriteriaQuery.processQuery}";
          invokeMethodExpression(bindingName, queryEvent);
       private void invokeMethodExpression(String expr, QueryEvent queryEvent) {
          FacesContext fctx = FacesContext.getCurrentInstance();
          ELContext elContext = fctx.getELContext();
          ExpressionFactory eFactory = fctx.getApplication().getExpressionFactory();
          MethodExpression mexpr =
             eFactory.createMethodExpression(elContext, expr, Object.class, new Class[] { QueryEvent.class });
          mexpr.invoke(elContext, new Object[] { queryEvent });
    When no inspection record number (the only search field so far)  is supplied in the query panel, then it behaves correctly. Namely, the tree tables shows all search results. However, when an inspection record number is supplied the tree table that was created with the query panel in use (remember there are two query panels, one of them is hidden) shows a single result (this is correct) while the other tree table (the one with the hidden query panel that isn't in use) shows all results (this is NOT correct).
    Is what I'm trying to accomplish even doable? If so, what am I missing?
    I'm using JDeveloper 11.1.1.7
    Thanks,
    Bill

    I ended up keeping one query panel permanently visible and the other permanently hidden. When performing a search using the table that has the hidden query panel, I seed the query descriptor for the hidden query panel using the visible query panel's query descriptor and then delegate the request:
       public void doSearch(QueryEvent queryEvent) {
          String bindingName = null;
          if(isIrTableRendered()) {
             bindingName = "#{bindings.IRSearchCriteriaQuery.processQuery}";
          } else {
             seedPartsQueryDescriptor();
             bindingName = "#{bindings.PartsVOCriteriaQuery.processQuery}";
             queryEvent = new QueryEvent(partsQuery, partsQuery.getValue());
          invokeMethodExpression(bindingName, queryEvent);
       private void seedPartsQueryDescriptor() {
          ConjunctionCriterion criterion = irQuery.getValue().getConjunctionCriterion(); 
          for(Criterion criteria : criterion.getCriterionList()) {
             AttributeCriterion attributeCriteria = (AttributeCriterion)criteria;
             List values = attributeCriteria.getValues();
             String qualifiedName = attributeCriteria.getAttribute().getName();
             int indexOfDot = qualifiedName.lastIndexOf(".");
             String name = indexOfDot < 0
                ? qualifiedName
                : qualifiedName.substring(indexOfDot + 1);
             ConjunctionCriterion partsCriterion =
                partsQuery.getValue().getConjunctionCriterion();
             for (Criterion partsCriteria : partsCriterion.getCriterionList()) {
                AttributeCriterion partsAttributeCriteria =
                   (AttributeCriterion) partsCriteria;
                String partsQualifiedName =
                   partsAttributeCriteria.getAttribute().getName();
                if (partsQualifiedName.endsWith(name)) {
                   partsAttributeCriteria.setOperator(attributeCriteria.getOperator());
                   List partsValues = partsAttributeCriteria.getValues();
                   partsValues.clear();
                   for (int i = 0, count = values.size(); i < count; i++) {
                      partsValues.set(i, values.get(i));
       private void invokeMethodExpression(String expr, QueryEvent queryEvent) {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          ELContext elContext = facesContext.getELContext();
          ExpressionFactory expressionFactory =
             facesContext.getApplication().getExpressionFactory();
          MethodExpression methodExpression =
             expressionFactory.createMethodExpression(elContext, expr, Object.class, new Class[] { QueryEvent.class });
          methodExpression.invoke(elContext, new Object[] { queryEvent });
    Then when the advanced/basic button is pressed for the visible query panel, I programmatically set the same mode for the hidden query panel:
       public void handleQueryModeChange(QueryOperationEvent queryOperationEvent) {
          if(queryOperationEvent.getOperation() == QueryOperationEvent.Operation.MODE_CHANGE) {
             QueryMode queryMode = (QueryMode) irQuery.getValue().getUIHints().get(QueryDescriptor.UIHINT_MODE);
             QueryDescriptor queryDescriptor = partsQuery.getValue();
             queryDescriptor.changeMode(queryMode);
             AdfFacesContext.getCurrentInstance().addPartialTarget(partsQuery);

  • 2.1EA2: Pinning Query Results and changing Connections [fixed in 2.1.0]

    I am on 2.1EA2 (JDK 1.6.0_16) and been playing with the new SQL Worksheet pin query results functionality. I have found that it is possible to run a query against one connection, pin the results and then change connection and run the same (or a different) query against another connection. I really like this, but found a few problems:
    #1 There doesn't seem to be any way to tell which connection a query result tab was actually run against
    #2 Even if all rows are fetched, if I then disconnect from the first connection it can get quite messy. Sometimes I get an empty connection dialog (I can't remember the exact title and it doesn't reproduce consistently) with only the close window X in the corner. Some times I get prompted to log in with a connection information dialog with no reference to the connection it is connecting to - cancelling only brings up the same dialog again until I successfully connect. Some times I get prompted to log in and while that is still on the screen, SQL Developer logs me back in to the connection (even though I don't save passwords) - I even get a new worksheet for the reconnected connection.
    theFurryOne

    Raghu,
    I am happy with both.
    #1 - I would be happy if the connection name was at the start of the tool-tip style pop-up when hovering over Query Results tab and the Query Result SQL dialog that opens on the SQL button. -K-'s suggestion makes it immediately obvious for the currently selected Query Results tab, without having to move the mouse or click on something.
    Ideally, I would like something similar for the other output tabs (ie Script Output), but they seem to show results for all connections that the worksheet has used, so the same concept may not work.
    #2 - I am used to the grid being cleared when disconnecting from earlier versions - I assumed that this was a bug where SQLD was not checking the connection of the results, just the current connection of the worksheet.
    theFurryOne

  • Query Regarding Query Results in CMC 3.1

    Hi,
    I want to check what reports are scheduled in particular folder. To get this information we can use query builder by writing a query,but i don't have access to query builder.
    Can we check in CMC without access to query builder?I have seen one option In CMC 'Query Results'. What exactly Query results do and how to use.Can this be use to retrieve what reports are scheduled?
    Regards
    Ranjith

    Hi Ranjith,
    Query Results option in CMC is an application through which you could create Security Queries. It would help you identify the security setup and access being setup on the objects in your enviornment.
    Regards,
    Nakul Mehta

  • Restricting the query result.

    Hello Experts ,
    Senario :
    I have Keyfigures 1)PO Line Item Count and 2) PO Value
    I want the number of PO Line Item having PO Value between 0 to 2,500$.
    I cant restrict a key figure with another keyfigure.
    Also in the query result i dont have any characteristic drilled, only key figure count is present.
    Please help.
    Thanks,
    Vinay

    Hi,
    Use RRI QUERY, Pass the query result of the first query to Second one and in the second query Use condition to display only       "Ito display the number of PO Line Item having PO Value between 0 to 2,500$."
    And Use "Count" function to display the number of Purchase Order Line items.
    Hope it helps...
    Regards.

  • Managing a query result through several web pages

    Hi,
    I wonder what's the best way to manage a query result through several web
    pages in the following context.
    The query result is large and needs to be available through several web
    pages. The user can scroll forward and backward through the pages.
    One can :
    - rerun the query at each web request and use random access
    - run the query once for the first request, keep the pm and the query
    somewhere (in a singleton class for example with a key in the HTTP
    session) and use random access for handling the other requests (the
    problems I see are to keep a connection for each user in this use case and
    to decide when to close the previously mentioned objects)
    - rerun the query at each web request, including in the filter a test on a
    field and an ordering to start the results from the last one displayed
    (being able to specify the maximum number of rows desired would be nice).
    Thanks for any advice or suggestion.
    Regards.

    I think Frank's suggestion is probably the best tradeoff between memory
    consumption (which would be high if you were to store the enire query
    result in the session) and performance (which might be hurt if you
    re-issue the query every time).
    Note that Kodo 3.0 will provide a getObjectsById(Object[] ids) method
    that should help in quickly instantiating a page of query results.
    Query result limiting is currently under discussion for inclusion in the
    JDO specification. We may have something for this in an upcoming Kodo
    release (although not for 3.0).
    In article <[email protected]>, Frank Riley wrote:
    [email protected] (Patrice) wrote in
    news:[email protected]:
    Hi,
    I wonder what's the best way to manage a query result through several
    web pages in the following context.
    The query result is large and needs to be available through several
    web pages. The user can scroll forward and backward through the pages.
    One can :
    - rerun the query at each web request and use random access
    - run the query once for the first request, keep the pm and the query
    somewhere (in a singleton class for example with a key in the HTTP
    session) and use random access for handling the other requests (the
    problems I see are to keep a connection for each user in this use case
    and to decide when to close the previously mentioned objects)
    - rerun the query at each web request, including in the filter a test
    on a field and an ordering to start the results from the last one
    displayed (being able to specify the maximum number of rows desired
    would be nice).For our paging code, we convert the query result to a list of object ids
    (using pm.getObjectId()). We store this list on the session and only
    instantiate the objects we need for a particular page (using
    pm.getObjectById()). When a user does something that could possibly
    change the query result, we rerun the query and replace the list on the
    sesssion.--
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • How can I avoid query result overlapping in Analysis for Office?

    Hello everybody
    I have a question relating to Analysis for Office. If I've a workbook with for example two queries, how can I avoid that the query above the other one overlaps the query results of the lower query?
    The lower query result should adapt according the the query results of the first query.
    Does anybody have an idea? In Bex Analyzer I have the Option to insert a scrollbar for a workbook- is this function available in Analysis für Office? (But that way isn't the way I prefer).
    Thank you in advance.
    Kind regards
    Heike

    Not sure about this - could you take a look at this thread that suggests VBA Placing two tables in Analysis for office without overlap
    I am wondering if the next release might help?  See Figure 1 of Analysis Roadmap Update - Beta Preview, Part 2

  • Interactive Reporting - Chg Query from Using Table to Result Set w/ same Co

    Currently I have a query that uses an Oracle table. I would like to change the query to use the result set of another query wh/ contains the same information & column names (however, since I am creating the results from scratch, I don't have to wait for the Oracle table to be updated). Is there a way to do this change w/o IR automatically removing the column names from the results and then making me go back into each result set and re-adding them, formatting them, etc. For example, the query currently uses a table called Defect_History, wh/ has columns bug_id, application, sub-app, etc. This table is not updated on a daily basis, so I have created a new query wh/ goes against the source tables used in creating the Defect_History table and puts the latest information into an IR result set. Is there a way to change the current queries that use the Defect_History table to use the IR result set instead w/o basically recreating each of the subsequent queries? I have gone into Dashboard Studio Optimize Utility, but the queries show as using Data Model, Data Model2, etc as the Parent and I am not able to make changes to it.
    Thanks.
    Terri

    I am in the Dashboard Studio - Optimize Utility. When I select that report (or any of the others), the Reparent button is grayed out on the toolbar. I've also tried right-clicking on the report and it's grayed out there as well. Any ideas?

Maybe you are looking for

  • Can not see wireless TM in disk utility or desktop.

    Am I running a TM Airport (router) it runs great, I love everything about it and the backups have no issues. But I wanted to partition my 500mb drive on my TM yet for some reason I can not see the drive either on my desktop or in disk utility. Is the

  • Error Invoking Database Adapter

    I am trying to create a simple bpel process which updates table in Oracle Database, but getting some JCA connection issue below: "<bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><

  • Automatic creation of Planned order

    Hi, Would like to know how to check if a certain material is set up in MRP to automatically create planned orders or should be cretead manually.  I have verified the material type and the value is already PD (Material requirements planning). Thanks,

  • External Data in Customs Declarations

    Hello - What BAdIs can be used to default external data from the Feeder System (but not from a PO, Inbound Delivery, or Goods Receipt document) into a GTS Customs Declaration?

  • Soa suite CD in Release 3

    Hi, I just want to find out how come there is a SOA Suite CD in the Apps Server R3 media pack but none in the Apps Server R2 media pack? Does this mean that I need to order a separate media pack for the Release 2 SOA? I noticed that only the BPEL Pro