Order of a Append Query?

I am trying to get  QryNoZeroUpdateFliltered to filter OwnerID  before my Dues function is called, is this possible. Thanks for any help........Bob
INSERT INTO tblOverdue ( OwnerID, ThreeMonths0, TwoMonths0, OneMonth0, Current0, ThreeMonth, TwoMonth, OneMonth, Currents )
SELECT DISTINCT tblOwnerInfo.OwnerID, Nz([3],0) AS tb3Months0, Nz([2],0) AS tb2Months0, Nz([1],0) AS tb1Month0, Nz([0],0) AS tbCurrent0, Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],3) AS tb3Months, Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],2)
AS tb2Months, Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],1) AS tb1Month, Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],0) AS tbCurrent
FROM ((tblOwnerInfo INNER JOIN qPayableTotalForPayment ON tblOwnerInfo.OwnerID = qPayableTotalForPayment.OwnerID) INNER JOIN QryNoZeroUpdateFliltered ON qPayableTotalForPayment.OwnerID = QryNoZeroUpdateFliltered.OwnerID) INNER JOIN qOverDueRep ON QryNoZeroUpdateFliltered.OwnerID
= qOverDueRep.OwnerID;
xxx

Hi TurnipOrange,
Could you please share a copy of your database file? Or just make a sample database if there's some confidential data, so that we can easily reproduce your problem. It's hard to identify the problem without the sample database.
Thanks!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Slooooow Append Query

    I have an append query that takes over an hour to run (which is fine), but when I use vba and call this append query it will never run.  I have 3 of these that are very similar.  Here is the query itself.  
    The select version of this query takes approx 3 min to run
    INSERT INTO CosiTemp ( Reg, <Group #>, Dist, Store, <Eligible Items>, <Plans Sold>, <Power Plus Success Rate>, <Power Plus Rank>, ppIndex, ppPotentialSales, <Power Plus Sales $>, <Trans w/A>, <Trans W/ A & B>, <Add-On Success Rate>, <Add-On Rank>, <Add-OnSales $>, aoIndex, aoPotentialSales, <Trans w/ Iotm>, <Units Sold>, <All Trans>, <IotM Sales $>, <Units Per Trans>, <IotM Rank>, ioIndex, ioPotentialSales, <Culture Of Selling Index>, <Additional Sales Potential>, dteDate, City, ST, <Open Date> )SELECT tblMainStoreList.Region, tblMainStoreList.<Group #>, tblMainStoreList.District, tblMainStoreList.<Store #>, pp.numOfItemsTrans, pp.numOfWarrantyTrans, <pp>.<numOfWarrantyTrans>/<pp>.<numOfItemsTrans> AS <Success Rate>, (select Count(*) from <qryPowerPlusStores> where <Success Rate> >= <pp>.<Success Rate> and <pp>!<District>= <District>;) AS ppRank, CDbl(IIf(<Success Rate>="","",<Success Rate>/perPowerPlus())) AS ppIndex, IIf(<ppIndex><1,((<numOfItemsTrans>*perPowerPlus())-<numOfWarrantyTrans>)*curPPCompanySales(),0) AS ppPotentialSales, pp.curPowerPlusSales, ao.SumofA, ao.Sumofb, ao.<Percent%>, (select Count(*) from <qryAddOnSummaryStores> where <Percent%> >= <ao>.<percent%> and <ao>!<District>= <District>;) AS aoRank, ao.<SumofSales$>, CDbl(IIf(<Percent%>="","",<Percent%>/perAddOn())) AS aoIndex, IIf(<aoIndex><1,((<sumofA>*perAddOn())-<sumofb>)*curAoCompanySales(),0) AS aoPotentialSales, io.SumOftrxwIotM, io.<SumOfSales Units>, io.TransCount, io.<SumOfSales$>, io.UnitsPerTrans, (select Count(*) from <qryIotmFromIotmDb> where <UnitsPerTrans> >= <io>.<unitsPerTrans> and <io>!<Districtt>= <Districtt>;) AS ioRank, CDbl(IIf(<unitsPerTrans>="","",<unitsPerTrans>/perIotM())) AS ioIndex, IIf(<ioIndex><1,((<TransCount>*perIotM())-<sumofsales Units>)*curIotMCompanySales(),0) AS ioPotentialSales, IIf(IsNull(<ppIndex>) And IsNull(<aoIndex>) And IsNull(<ioIndex>),0,(Nz(<ppIndex>)+Nz(<aoIndex>)+Nz(<ioIndex>)))/(IIf(IsNull(<ppIndex>),0,1)+IIf(IsNull(<aoIndex>),0,1)+IIf(IsNull(<ioIndex>),0,1)) AS Cosi, <ppPotentialSales>+<aoPotentialSales>+<ioPotentialSales> AS ttlPotSales, Date() AS Expr1, tblMainStoreList.City, tblMainStoreList.ST, tblMainStoreList.<Open Date>FROM qryIotmFromIotmDb AS io INNER JOIN (qryAddOnSummaryStores AS ao INNER JOIN (qryPowerPlusStores AS pp INNER JOIN tblMainStoreList ON pp.<Store> = tblMainStoreList.<Store #>) ON ao.Store = tblMainStoreList.<Store #>) ON io.<Store No> = tblMainStoreList.<Store #>;
    I have also set Use Transaction to No in the query properties.  
    Thanks in advance for the help!!

    As msdnPublicIdentity has suggested, reformulate your query as a series of "subqueries". To get you going, peel things out of your
    queries, starting from the inside
    INSERT INTO
    CosiTemp(
    Reg,
    [Group #],
    Dist,
    Store,
    [Eligible Items],
    [Plans Sold],
    [Power Plus Success Rate],
    [Power Plus Rank],
    ppIndex,
    ppPotentialSales,
    [Power Plus Sales $],
    [Trans w/A],
    [Trans W/ A & B],
    [Add-On Success Rate],
    [Add-On Rank],
    [Add-OnSales $],
    aoIndex,
    aoPotentialSales,
    [Trans w/ Iotm],
    [Units Sold],
    [All Trans],
    [IotM Sales $],
    [Units Per Trans],
    [IotM Rank],
    ioIndex,
    ioPotentialSales,
    [Culture Of Selling Index],
    [Additional Sales Potential],
    dteDate,
    City,
    ST,
    [Open Date]
    SELECT
    tblMainStoreList.Region,
    tblMainStoreList.[Group #],
    tblMainStoreList.District,
    tblMainStoreList.[Store #],
    pp.numOfItemsTrans,
    pp.numOfWarrantyTrans,
    [pp].[numOfWarrantyTrans] / [pp].[numOfItemsTrans] AS [Success Rate],
    select
    Count(*)
    from
    [qryPowerPlusStores]
    where
    [Success Rate] >= [pp].[Success Rate]
    AND
    [pp]![District] = [District]
    ) AS ppRank,
    CDbl(IIf([Success Rate] = "", "", [Success Rate] / perPowerPlus())) AS ppIndex,
    IIf([ppIndex] < 1,(([numOfItemsTrans] * perPowerPlus()) - [numOfWarrantyTrans]) * curPPCompanySales(), 0) AS ppPotentialSales,
    pp.curPowerPlusSales,
    ao.SumofA,
    ao.Sumofb,
    ao.[Percent%],
    select
    Count(*)
    from
    [qryAddOnSummaryStores]
    where
    [Percent%] >= [ao].[percent%]
    AND
    [ao]![District] = [District]
    ) AS aoRank,
    ao.[SumofSales$],
    CDbl(IIf([Percent%] = "", "", [Percent%] / perAddOn())) AS aoIndex,
    IIf([aoIndex] < 1,(([sumofA] * perAddOn()) - [sumofb]) * curAoCompanySales(), 0) AS aoPotentialSales,
    io.SumOftrxwIotM,
    io.[SumOfSales Units],
    io.TransCount,
    io.[SumOfSales$],
    io.UnitsPerTrans,
    select
    Count(*)
    from
    [qryIotmFromIotmDb]
    where
    [UnitsPerTrans] >= [io].[unitsPerTrans]
    AND
    [io]![Districtt] = [Districtt]
    ) AS ioRank,
    CDbl(IIf([unitsPerTrans] = "", "", [unitsPerTrans] / perIotM())) AS ioIndex,
    IIf([ioIndex] < 1,(([TransCount] * perIotM()) - [sumofsales Units]) * curIotMCompanySales(), 0) AS ioPotentialSales,
    IIf(IsNull([ppIndex])
    And IsNull([aoIndex])
    And IsNull([ioIndex]), 0,(Nz([ppIndex]) + Nz([aoIndex]) + Nz([ioIndex]))) /(IIf(IsNull([ppIndex]), 0, 1) + IIf(IsNull([aoIndex]), 0, 1) + IIf(IsNull([ioIndex]), 0, 1)) AS Cosi,
    [ppPotentialSales] + [aoPotentialSales] + [ioPotentialSales] AS ttlPotSales,
    Date() AS Expr1,
    tblMainStoreList.City,
    tblMainStoreList.ST,
    tblMainStoreList.[Open Date]
    FROM
    qryIotmFromIotmDb AS io
    INNER JOIN
    (qryAddOnSummaryStores AS ao
    INNER JOIN
    (qryPowerPlusStores AS pp
    INNER JOIN tblMainStoreList
    ON pp.[Store] = tblMainStoreList.[Store #]
    ON ao.Store = tblMainStoreList.[Store #]
    ON io.[Store No] = tblMainStoreList.[Store #]
    peter n roth - http://PNR1.com, Maybe some useful stuff

  • Parameter for ORDER BY in DAX query not respected

    I have an SSRS table fed by a parameterized DAX query (utilizing the methods in
    thesearticles). I have all of my parameters working just fine except for those feeding my closing ORDER BY statement (I am offloading the sorting
    to the Tabular for several reasons, including a large tested performance gain over sorting in SSRS). I have defined the ORDER BY as follows:
    ORDER BY @Order1, @Order2, @Order3, @Order4
    I cannot get even the first parameter to work. I can pass arbitrary strings with no impact on the report returned, though if I hard code the ORDER BY in the query, the ordering is respected, so I know this is a problem with the parameter.
    Running a Profiler trace on the server when I fire the SSRS report returns the following as the parameter value for @Order1:
    <Parameter>
    <Name>Order1</Name>
    <Value xsi:type="xsd:string">Dimuser[UserID-Name]</Value>
    This is exactly what I want to replace @Order1, and when I hard code that exact string into my query I get the behavior I want.
    I have played with \ escaping the brackets to no avail.
    Any insight is greatly appreciated.

    I have discovered a workable solution to my own problem.
    The parameter is passed and interpreted as a quoted string, rather than as a field name.
    I altered my query to follow this general format:
    ORDER BY
    SWITCH( TRUE()
    , @Order1 = "User", DimUser[UserID-Name]
    , SWITCH( TRUE()
    , @Order2 = "User", DimUser[UserID-Name]
    In this way I am comparing two quoted strings for equality and providing an unquoted field identifier that Tabular recognizes and can order by.

  • Group by order by in same query

    Hi,
    I am wondering whether it is possible to use group by and order by in same query
    For example if i have a table like the one below
    Col1 Col2 col3
    C 36 2
    A 25 5
    B 12 8
    A 25 6
    B 12 9
    C 36 1
    A 25 7
    I need a result like below
    A 25 5
    A 25 6
    A 25 7
    B 12 8
    B 12 9
    C 36 1
    C 36 2
    can the select statement with group by and order by solve this? How?

    Yes you can - though I am not sure that it is what you want. In your example you do not need to group the data, you just need to order by the first column, then the third. If required, you could also throw in the second column;
    SQL> with t as  ( 
       select 'C' col1, 36 col2, 2 col3 from dual union all 
       select 'A', 25 ,5 from dual union all 
       select 'B', 12 ,8 from dual union all 
       select 'A', 25 ,6 from dual union all 
       select 'B', 12 ,9 from dual union all 
       select 'C', 36 ,1 from dual union all   
       select 'A', 25 ,7 from dual)  
    select col1,col2,col3  
    from t
    order by col1,col3
    COL1       COL2       COL3
    A            25          5
    A            25          6
    A            25          7
    B            12          8
    B            12          9
    C            36          1
    C            36          2

  • Append Query with multi values

    I am attempting to append information into a new database. The old project information has some fields that are multi-value. Apparently an append query cannot handle this. Is there a way I can over come this?

    Hi
    >>Apparently an append query cannot handle this
    Have you got some error? What's the problem you have encountered? Could you please show the sql you are using or share a sample to reproduce this ?
    If you're adding a value to your multi-valued field, you can us an append query like this,
    Insert into table (FieldName.value) values (value)
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • ORDER BY in cmis query

    I have a custom metadata field in ucm and I need to sort content presenter result based on that field. I have followed http://yonaweb.be/using_dynamic_queries_content_presenter_0 document and used cmis query to show content. My getter method of query looks like
    public String getContentQuery(){
    StringBuffer query = new StringBuffer();
    query.append("SELECT * FROM ora:t:IDC:GlobalProfile WHERE ora:p:xRegionDefinition = 'UPDATE_REG_DEF'");
    String contentType= (String)ADFUtil.evaluateEL("#{viewScope.pLinkSelectionType}");
    if("News".equals(contentType)){
    query.append( " and ora:p:xUpdateContentType = 'News'");
    if("Event".equals(contentType)){
    query.append( " and ora:p:xUpdateContentType = 'Event'");
    if("Insight".equals(contentType)){
    query.append( " and ora:p:xUpdateContentType = 'Insight'");
    query.append(" ORDER BY ora:p:xDocumentSortDate DESC");
    return query.toString();
    It works fine when load the page first time but after that if we change value of documentsortdate in ucm and try to reload the page, it shows same result. Looks like result is getting cached. On reloading my getContentQuery method is getting called so I believe content presenter flow is getting executed.
    Thanks
    Sanjeev.

    I tried to introduce a delete button to delete content. I set a refresh condition on contentpresenter task-flow as #{requestScope.pRefreshUpdateSection == 'Y'}. Now on delete button I am calling following bean method.
    public void deleteContent(ActionEvent actionEvent) {
    // Add event code here...
    String dID = ((ValueWrapperImpl)ADFUtil.evaluateEL("#{node.propertyMap['dID'].value}")).getStringValue();
    String dDocName = ((ValueWrapperImpl)ADFUtil.evaluateEL("#{node.propertyMap['dDocName'].value}")).getStringValue();
    String user = (String)ADFUtil.evaluateEL("#{securityContext.userName}");
    RIDCUtil ridc;
    try {
    ridc = new RIDCUtil();
    ridc.deleteDocument(user, dDocName, dID);
    ADFUtil.getRequestFlowScope().put("pRefreshUpdateSection", "Y");
    } catch (IdcClientException e) {
    String errorMessage = "An unexpected error occured while deleting document. Please contact the System Administartor." + e.getCause();
    throw new JboException(errorMessage);
    RIDC is able to delete content successfully but when contentpresenter binding is getting executed, its still looking for old content. Ideally it should start executing new query and start showing content as per new query. I get following error instead.
    <UIXRegion> <_warn> Error processing viewId: /doclib-content-presenter/presenter-multi-node-view URI: /oracle/webcenter/doclib/view/jsf/taskflows/presenter/presenterMultiView.jsff actual-URI: /oracle/webcenter/doclib/view/jsf/taskflows/presenter/presenterMultiView.jsff.
    oracle.webcenter.content.integration.RepositoryRuntimeException: Dec 10, 2012 1:49:50 PM oracle.webcenter.content.integration.spi.ucm.NodeOps getVcrGetDocumentByNameDataBinder
    SEVERE: Unable to fetch document in repository UCM with dDocName VMOHSKEND03633000335. When calling service VCR_GET_DOCUMENT_BY_NAME, as user sponsor, at timestamp 12/10/12 1:49 PM, recieved status code -16.
         at oracle.webcenter.content.integration.Node.getProperties(Node.java:867)
         at oracle.webcenter.content.integration.Node.getProperties(Node.java:795)
         at oracle.webcenter.content.integration.Node.getProperty(Node.java:692)
         at oracle.webcenter.content.integration.el.support.NodeWrapperImpl.getProperty(NodeWrapperImpl.java:278)
         at oracle.webcenter.content.integration.el.support.ContentPropertyMap.getProperty(ContentPropertyMap.java:159)
         at oracle.webcenter.content.integration.el.support.ContentPropertyMap.get(ContentPropertyMap.java:90)
         at oracle.webcenter.content.integration.el.support.ContentPropertyMap.get(ContentPropertyMap.java:46)
         at javax.el.MapELResolver.getValue(MapELResolver.java:164)
         at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:173)
         at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:200)
         at com.sun.el.parser.AstValue.getValue(Unknown Source)
         at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
         at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:68)
         at oracle.adfinternal.view.faces.renderkit.rich.ValueRenderer.getValue(ValueRenderer.java:184)
         at oracle.adfinternal.view.faces.renderkit.rich.ValueRenderer.getConvertedString(ValueRenderer.java:145)
         at oracle.adfinternal.view.faces.renderkit.rich.OutputTextRenderer.encodeAll(OutputTextRenderer.java:148)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeHorizontalChild(PanelGroupLayoutRenderer.java:499)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$100(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:659)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
         at oracle.webcenter.content.internal.view.template.TemplateSwitcher.processFlattenedChildren(TemplateSwitcher.java:161)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:160)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
         at org.apache.myfaces.trinidad.component.UIXIterator$1.process(UIXIterator.java:163)
         at org.apache.myfaces.trinidad.component.UIXIterator$Runner.processComponent(UIXIterator.java:566)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at org.apache.myfaces.trinidad.component.UIXIterator$Runner.run(UIXIterator.java:535)
         at org.apache.myfaces.trinidad.component.UIXIterator.processFlattenedChildren(UIXIterator.java:166)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:160)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
         at org.apache.myfaces.trinidad.component.UIXGroup.encodeChildren(UIXGroup.java:138)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer._encodeChildren(RegionRenderer.java:278)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.encodeAll(RegionRenderer.java:201)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at oracle.adf.view.rich.component.fragment.UIXRegion.encodeEnd(UIXRegion.java:300)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at oracle.adfinternal.view.faces.renderkit.rich.customizable.PanelCustomizableRenderer.encodeChildrenVertically(PanelCustomizableRenderer.java:1053)
         at oracle.adfinternal.view.faces.renderkit.rich.customizable.PanelCustomizableRenderer.encodeAll(PanelCustomizableRenderer.java:356)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at oracle.adfinternal.view.page.editor.renderkit.PageCustomizableRenderer.encodeAll(PageCustomizableRenderer.java:323)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at org.apache.myfaces.trinidad.component.UIXGroup.processFlattenedChildren(UIXGroup.java:96)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:160)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at oracle.adfinternal.view.faces.taglib.region.IncludeTag$FacetWrapper.processFlattenedChildren(IncludeTag.java:675)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:160)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    <removed some log>
    Caused by: oracle.webcenter.content.integration.NoSuchNodeException: Dec 10, 2012 1:49:50 PM oracle.webcenter.content.integration.spi.ucm.NodeOps getVcrGetDocumentByNameDataBinder
    SEVERE: Unable to fetch document in repository UCM with dDocName VMOHSKEND03633000335. When calling service VCR_GET_DOCUMENT_BY_NAME, as user sponsor, at timestamp 12/10/12 1:49 PM, recieved status code -16.
         at oracle.webcenter.content.integration.spi.ucm.NodeOps.getVcrGetDocumentByNameDataBinder(NodeOps.java:1683)
         at oracle.webcenter.content.integration.spi.ucm.NodeOps.getUCMNodeWithId(NodeOps.java:1569)
         at oracle.webcenter.content.integration.spi.ucm.NodeOps.getProperties(NodeOps.java:385)
         at sun.reflect.GeneratedMethodAccessor758.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.webcenter.content.integration.federated.internal.delegate.LatestInterfaceVersionWrapper.invoke(LatestInterfaceVersionWrapper.java:73)
         at $Proxy188.getProperties(Unknown Source)
         at oracle.webcenter.content.integration.federated.internal.filter.logging.NOPSLoggingFilter.getProperties(NOPSLoggingFilter.java:371)
         at sun.reflect.GeneratedMethodAccessor757.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.webcenter.content.integration.federated.internal.delegate.LatestInterfaceVersionWrapper.invoke(LatestInterfaceVersionWrapper.java:73)
         at $Proxy188.getProperties(Unknown Source)
         at oracle.webcenter.content.integration.federated.internal.filter.validation.NOPSValidationFilter.getProperties(NOPSValidationFilter.java:379)
         at sun.reflect.GeneratedMethodAccessor756.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.webcenter.content.integration.federated.internal.delegate.LatestInterfaceVersionWrapper.invoke(LatestInterfaceVersionWrapper.java:73)
         at $Proxy188.getProperties(Unknown Source)
         at oracle.webcenter.content.integration.federated.internal.filter.cache.NOPSCacheFilter.getProperties(NOPSCacheFilter.java:457)
         at sun.reflect.GeneratedMethodAccessor755.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.webcenter.content.integration.federated.internal.delegate.LatestInterfaceVersionWrapper.invoke(LatestInterfaceVersionWrapper.java:73)
         at $Proxy188.getProperties(Unknown Source)
         at oracle.webcenter.content.integration.federated.internal.delegate.LatestNodeOpsDelegate.getProperties(LatestNodeOpsDelegate.java:585)
         at oracle.webcenter.content.integration.Node.getProperties(Node.java:833)
         ... 277 more
    Caused by: oracle.stellent.ridc.protocol.ServiceException: Unable to retrieve information for 'VMOHSKEND03633000335'. Unable to find latest released revision for item 'VMOHSKEND03633000335'.
         at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:142)
         at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
         at oracle.webcenter.content.integration.spi.ucm.UCMBridge.executeRequest(UCMBridge.java:778)
         at oracle.webcenter.content.integration.spi.ucm.NodeOps.getVcrGetDocumentByNameDataBinder(NodeOps.java:1671)
         ... 304 more
    Pagedef binding looks like
    <taskFlow id="doclibcontentpresenter2"
    taskFlowId="/oracle/webcenter/doclib/view/jsf/taskflows/presenter/contentPresenter.xml#doclib-content-presenter"
    activation="deferred"
    xmlns="http://xmlns.oracle.com/adf/controller/binding"
    Refresh="ifNeeded"
    RefreshCondition="#{requestScope.pRefreshUpdateSection == 'Y'}">
    <parameters>
    <parameter id="taskFlowInstId" value="${'myinst'}"/>
    <parameter id="datasourceType" value="${'dsTypeQueryExpression'}"/>
    <parameter id="datasource"
    value="#{backingBeanScope.NewsAndEventBean.contentQuery}"/>
    <parameter id="templateCategory" value="${''}"/>
    <parameter id="templateView" value="${'templates.news.list'}"/>
    <parameter id="regionTemplate" value="${'false'}"/>
    <parameter id="maxResults" xmlns="http://xmlns.oracle.com/adfm/uimodel"
    value="#{backingBeanScope.NewsAndEventBean.contentMaxResult}"/>
    </parameters>
    getContentQuery method of bean returns query and getContentMaxResult method returns number of max result as
    public Long getContentMaxResult(){
    String contentType= (String)ADFUtil.evaluateEL("#{viewScope.pLinkSelectionType}");
    if("News".equals(contentType) || "Event".equals(contentType) || "Insight".equals(contentType)){
    return 5L;
    else
    return 15L;
    public String getContentQuery(){
    StringBuffer query = new StringBuffer();
    query.append("SELECT * FROM ora:t:IDC:GlobalProfile WHERE ora:p:xRegionDefinition = 'REL3_UPDATE_REG_DEF'");
    String contentType= (String)ADFUtil.evaluateEL("#{viewScope.pLinkSelectionType}");
    if("News".equals(contentType)){
    query.append( " and ora:p:xUpdateContentType = 'News'");
    if("Event".equals(contentType)){
    query.append( " and ora:p:xUpdateContentType = 'Event'");
    if("Insight".equals(contentType)){
    query.append( " and ora:p:xUpdateContentType = 'Insight'");
    query.append(" ORDER BY ora:p:xDocumentSortDate DESC");
    return query.toString();
    As content presenter is looking for old file, I think some kind of caching is going on.
    Thanks
    Sanjeev

  • Purchase Order with Goods Receipts Query

    Hi Guys,
    Am still getting to grips with JOINS, I am trying to get a query completed that will show all Purchase Orders that have outstanding items on them, but I would like to also show any corresponding Goods Reciept Notes for that Purchase Order, showing the individual lines with outstanding balances. Here is what I have so far:
    SELECT DISTINCT T0.[CardCode] as [BP Code], T0.[CardName] as [BP Name], T0.[DocNum] as [PO Number], T0.[DocDate]as [PO Date], T1.[ItemCode] as [Stock Item], T1.[Quantity], T1.[OpenQty], T2.[DocNum] as [Goods Receipt No], T2.[DocDate]as [GR Date], T3.[ItemCode] as {Stock Item], T3.[Quantity], T3.[OpenQty] as [Left to Deliver]
    FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry, OPDN T2 INNER JOIN PDN1 T3 ON T2.DocEntry = T3.DocEntry
    WHERE T0.[DocDate]  >=[%0] AND  T0.[DocDate] <=[%1] AND  T0.[CardName] =[%2]
    I do only want to show the BP once for a given PO (hence my attempt at the DISTINCT command). Could someone be so kind as to point me in the right direction as I will want to turn this into a Crystal Report as well.
    Many thanks in advance
    Sean Martin

    I have double checked your query logic. It can not hold true. Here is the right logic:
    SELECT T0.[CardCode] as [BP Code], T0.[CardName] as [BP Name],
    T0.[DocNum] as [PO Number], T1.[ItemCode] as [Stock Item],
    T1.[Quantity], T1.[OpenQty],
    SUM(isnull(T3.[Quantity],0)) as 'Received Qty',
    T1.[Quantity]-SUM(isnull(T3.[Quantity],0)) as [Left to Deliver]
    FROM dbo.OPOR T0 
    INNER JOIN dbo.POR1 T1 ON T0.DocEntry = T1.DocEntry
    LEFT JOIN dbo.PDN1 T3 ON T3.BaseEntry = T0.DocEntry AND T3.BaseLine = T1.Linenum
    LEFT JOIN dbo.OPDN T2 ON T2.DocEntry = T3.DocEntry
    WHERE T0.[DocDate]  >=[%0] AND T0.[DocDate] <=[%1] AND T0.[CardName] =[%2]
    GROUP BY T0.[CardCode], T0.[CardName], T0.[DocNum], T1.[ItemCode],
    T1.[Quantity], T1.[OpenQty]
    The column 'Left to Deliver' should be identical to 'Remaining Open Qty'
    Thanks,
    Gordon

  • Can we combine Query for cancelled requisitions and query for internal requisitions without internal sales order into a single query

    Hi All,
    Greetings.
    I have two queries namely,
    1.Query for cancelled requisitions and
    2.Query for Internal Requisitions without Internal Sales Orders.
    I was on a task to combine those two queries..
    Can we do that? if so, please help me do that..
    Thanks in Advance,
    Bhaskar.

    Hi All,
    Greetings.
    I have two queries namely,
    1.Query for cancelled requisitions and
    2.Query for Internal Requisitions without Internal Sales Orders.
    I was on a task to combine those two queries..
    Can we do that? if so, please help me do that..
    Thanks in Advance,
    Bhaskar.

  • Help needed in - appending query string

    Hai All,
    Its very Urgent for me.Can anyone pls tell me how can I do the following.
    I want the query String of first page to be appended to the next following pages also.

    u want first page URL to second page or page data?

  • Column order in a select * query

    Suppose I have 256 columns in a table and if I query select * from  tablename ,what will the column order in the result.Will this be always same as order as in created statement?

    If the columns were all in the original CREATE TABLE statement, then, yes, the ordering of columns in SELECT * FROM will match the order from the CREATE TABLE statement.
    If columns were added after the initial create, then the original columns will come first (in their order) and then the added columns (in their order), etc.
    In the real world, it is a very bad practice to use SELECT * and have expectations about the ordering of the columns. Consider this scenario:
    Table T was created and implemented in production a year ago with columns A, B, C
    A project started up three months ago and added column D but the project is stalled in development. So in development T had columns A, B, C, D
    Later, another project started up and added columns E and F. Unlike the other project, it has progressed to Test. and Production. So in Development the table has columns A, B, C, D, E, F. In test and production the table has columns A, B, C, E, F.
    Now that stuck project has progressed to Test and Production. Now T has columns A, B, C, E, F, D in test and production but still A, B, C, D, E, F in development.
    Until someone notices and decides to fix it (where and how?)
    Be very, very careful about using SELECT *.

  • Order by  in sql query

    I am executing one sql query with order by clause.
    how to check sort is happing in memory or disk ?
    what are all the init parameter affect in order by clause

    There are a couple of ways.
    1. Query the V$MYSTAT view before and after your query and take the delta of the statistics. A query to retrieve sort information could be the following:
    SELECT name,value FROM V$mystat m JOIN v$statname USING (statistic#) where name like 'sorts%';2. In SQL*Plus Set AUTOTRACE TO STATISTICS and run your query. The sort information will be at the bottom.
    Sample:
    SQL > set autotrace off;
    SQL > SELECT name,value FROM V$mystat m JOIN v$statname USING (statistic#) where name like 'sorts%';
    NAME                                                                  VALUE
    sorts (memory)                                                           12
    sorts (disk)                                                              0
    sorts (rows)                                                             42
    SQL > SET AUTOTRACE TRACEONLY STATISTICS
    SQL > SELECT * FROM (SELECT OBJECT_NAME FROM ALL_OBJECTS WHERE ROWNUM <= 100) ORDER BY OBJECT_NAME;
    100 rows selected.
    Statistics
            674  recursive calls
              0  db block gets
            245  consistent gets
              0  physical reads
              0  redo size
           2257  bytes sent via SQL*Net to client
            462  bytes received via SQL*Net from client
              8  SQL*Net roundtrips to/from client
             31  sorts (memory)
              0  sorts (disk)
            100  rows processed
    SQL > SET AUTOTRACE OFF;
    SQL > SELECT name,value FROM V$mystat m JOIN v$statname USING (statistic#) where name like 'sorts%';
    NAME                                                                  VALUE
    sorts (memory)                                                           43
    sorts (disk)                                                              0
    sorts (rows)                                                            173HTH!

  • ORDER BY IN HIERARCHIAL QUERY

    Cosider the following record set from the emp table.
    empno ename mgr
    7839 KING     
    7566 SCOTT 7839
    7566 BLAKE 7839
    7782 CLARK 7839
    If I use the following hierarchial query to populate a tree in Oracle forms
    I will get the result as shown below.
    Query
    =====
    select -1, level, ename, null, ename
    from emp
    where empno in (7839,7566,7698,7782)
    start with ename = 'KING'
    connect by mgr = prior empno;
    Result
    ======
    KING
    JONES
    BLAKE
    CLARK
    Here is my problem. Though diffrent employees can work under a manager,
    we have some internal rules that assigns an order to each employee who
    works under a manager. This helps us in identifying who should take
    charge in the absence of a manager.
    I have added one column to the emp table, in order to store the order in
    which the employee reports to the manager.
    Now the record set becomes
    empno ename mgr emp_order
    7839 KING     0
    7566 SCOTT 7839 1
    7566 BLAKE 7839 3
    7782 CLARK 7839 2
    Now I want the forms tree to be displayed as shown below.
    KING
    JONES
    CLARK
    BLAKE
    (In short, I want the records in a particular level to be displayed
    according to a pre-defined order, rather than getting them displayed
    randomly).
    Which query can I use for this purpose ?
    Please help....
    Shibu

    Hi Guys,
    Thanks a lot for your suggestions.
    It really works great in SQL Plus.
    I am familiar with Oracle Forms and I know how to use it if I want to build a tree in Forms.
    Here is my requirement. I want to build the application using Oracle Portal. I know that there is something called 'Hierarchy' available in Portal. I don't know up to what extend it gives flexibility in programatically populating the tree.
    Here is the scenario. I will use the hierarchial query with CONNECT SIBLINGS BY clause to populate the a tree which will show me employees in a department hierarchially.
    Eg:
    KING
    SCOTT
    BLAKE
    SMITH
    Now I like to show the projects assigned to each employee, which itself can be considered as another hierarchy.
    Eg of Projects hierarchy.
    Projects
    Development
    Oracle Applications
    HRMS
    Support
    Intranet Applications
    Suppose SCOTT is working in HRMS project, the tree should show as,
    KING
    SCOTT
    Projects
    Development
    Oracle Applications
    HRMS
    BLAKE
    SMITH
    I can color code the node which will distinguish between an employee and his assignments.
    Is there a way to achieve it in Oracle Portal using the 'Hierarchy' or what may be the best way to go (Applet etc...) ???
    Thanks in advance for your help.
    Shibu

  • Order By in Named Query

    Hello,
    is it possible to set ORDER BY in a Named Query Expression build through the Expression Builder?
    Or is it possible to trigger this while executing the Named Query in the UnitOfWork?
    Thanks,
    Thomas

    Nemata,
    The mapping editor in JDeveloper does not yet allow you to configure query ordering. To do this you will need to write a piece of code called an after-load or ammendment method that customizes descriptor configuration when being loaded from the XML representation. In this method you will look up the query you defined and customize any additional settings, such as ordering.
    An example after-load method would be placed on any arbitrary helper class and would look like:
        public static void afterLoadEmployee(ClassDescriptor descriptor) {
            ReadAllQuery raq = (ReadAllQuery)descriptor.getDescriptorQueryManager().getQuery("findAllEmployee");
            raq.addAscendingOrdering("lastName");
        }To have this method invoked you will need to configure it on the descriptor in the JDeveloper mapping editor.
    1. In the structure pane when the map is selected go to the descriptor for the class you wish to customize its query.
    2. Using the right mouse menu on the descriptor select the advanced properties sub-menu and select 'after-load'. This will enable the additional after-load tab on the descriptor's editor.
    3. In this after-load panel you will need to specify the helper class where the static after-load method is written as well as the signature for the method wanted.
    Now, the next time the application is run this method will be invoked and you ordering customizations will be applied.
    This may sound a little complex but is a very useful technique for configuration or customization of descriptor, mapping, or query parameters that are not visible in the mapping editor or are more easily accomplished through code.
    Doug

  • Order by in select query

    Hi guys
    i am getting problem in my select query which is creating one long string, it is working fine without order by but when i run this with order by it get hanged. this query using on function to concatenate multiple strings in one string as well
    Please help me what i am doing wroing.
    select
    regexp_substr(pe.emp_id,'[0-9]+$') ||'|'||
    p.title ||'|'||
    cdt.text||'|'||
    j.tit||staff_pcb.host_pub_tit ||'|'||
    jou.vol ||pcb.vol||pcp.vol ||'|'||
    jou.journal_number||'|'||
    substr (jou.pages||pcb.pages||pcp.pages, 1, instr (jou.pages||pcb.pages||pcp.pages, '-')-1)||'|'||
    substr (jou.pages||pcb.pages||pcp.pages, instr (jou.pages||pcb.pages||pcp.pages, '-')+1)||'|'||
    pcb.st||jou.st||pcp.st||'|'||
    concat_aut(p.id)
    from pub p,journal j,caa c,person pe,class_t cdt,
    (select pcj.pub_id,pcj.vol,pcj.pages,pcja.st
    From pub_C_j_a pcja,pc_j pcj
    where pcja.pub_c_j_id = pcj.pub_id)jou,
    (select pcb.pub_id,pcb.host_pub_tit,pcb.pages,pcb.vol,pcba.st
    From pub_c_b pcb,pub_c_b_a pcba
    where pcba.pub_c_b_id = pcb.pub_id)pcb,
    (select pcp.pub_id,pcp.vol,pcp.pages,pcpa.st
    From pub_c_p pcp,pub_c_p_a pcpa
    where pcpa.pub_c_p_id = pcp.pub_id)pcp,
    where
    p.id = c.pub_id
    and c.person_id = pe.id
    and p.t_c_id = cdt.c_id
    and p.journal_id = j.id(+)
    and p.id = jou.publication_id(+)
    and p.id = pcb.publication_id(+)
    and p.id = pcp.publication_id(+)
    and substr(regexp_substr(pe.emp_id,'[0-9]+$'),1,2) in('77','78')
    and pcb.st||jou.st||pcp.st='1' order by pe.emp_id
    ;

    Not sure about why it's only hanging on order by but looks like your query causing full table scan because of this in WHERE clause:
    and pcb.st||jou.st||pcp.st='1'
    I would change it to something like:
    and ((pcb.st='1'  and jou.st = '' and pcp.st = '') or (jou.st='1'  and pcb.st = '' and pcp.st = '')  or (pcp.st='1'  and jou.st = '' and pcb.st  = '') )

  • How to have customised order in a SQL query

    say there is a column name ename having values shailesh,Shailesh,ruchi,Ramesh,carl,Celin
    i need a order of
    carl,Celine,ruchi,Ramesh,shailesh,Shailesh
    how to do that

    it will certenlly help, try this one-
    First u need to create a function to change the case. e.g.-
    create or replace function chg_case(str varchar2) return varchar2 is
    chr char(1);
    nstr varchar2(255);
    begin
    for i in 1..length(str) loop
    chr := substr(str,i,1);
    if chr = Upper(chr) then
    nstr := nstr&#0124; &#0124;lower(chr);
    else
    nstr := nstr&#0124; &#0124;upper(chr);
    end if;
    end loop;
    return nstr;
    end;
    now see the the result of this query-
    1 select name from (
    2 select name, upper(substr(name,1,1)) lcs, substr(chg_case(name),1,40) nm from tst order by 2,3
    3* ) t
    SQL> /
    NAME
    carl
    Celin
    ruchi
    Ramesh
    shailesh
    Shailesh
    6 rows selected.
    null

Maybe you are looking for