Replicate query

Hi ,
Could anyone help me replicate this query in obiee.
select A1.PROPOSITIEGROEP,count(A1.SUBSCRIPTION_ID) from
(SELECT
SUBSCRIPTION_ID,PRODUCT_ID,PROPOSITIEGROEP,ACCESS_PRD_SUBS_START_DT
FROM
V_ARM_SUBSCRIPTION_FACT_temp A
LEFT JOIN
V_ARM_ACCESS_PRODUCT_temp B
ON
A.ACCESS_PRODUCT_ID=B.PRODUCT_ID ) A1,
SELECT
SUBSCRIPTION_ID,PRODUCT_ID,PROPOSITIEGROEP,ACCESS_PRD_SUBS_END_DT
FROM
V_ARM_SUBSCRIPTION_FACT_temp A
LEFT JOIN
V_ARM_ACCESS_PRODUCT_temp B
ON
A.ACCESS_PRODUCT_ID=B.PRODUCT_ID ) A2
where A1.SUBSCRIPTION_ID=A2.SUBSCRIPTION_ID
and A1.ACCESS_PRD_SUBS_START_DT=A2.ACCESS_PRD_SUBS_END_DT
and A1.PROPOSITIEGROEP<>A2.PROPOSITIEGROEP

You need to make use of the Advanced tab in Answers and build the SQL there.
Read this link for details:
http://gerardnico.com/wiki/dat/obiee/multiple_subject_area

Similar Messages

  • Query to replicate the Bill of Materials Report

    I'm looking to recreate the Bill of Materials report as a query, mostly because i cannot add any new database fileds to the pld report.
    As i cannot amend/change the screen layout or PLD i would like to recreate the report as a  query but have struggled to get a query to show the expanded layers of the BoM as the report does.

    Following is one I wrote to find cost vs sell price & GP for Production BOM's.
    You may be able to modify it to include what you need?
    {SELECT T0.[Father],
    sum ( T2.[AvgPrice]* T0.[Quantity]) as [Cost],T3.[Price] AS [Sales Price], 
    (t3.Price - sum(T2.[AvgPrice] * T0.Quantity)) as [GP] ,
    (t3.Price - sum(T2.[AvgPrice] * T0.Quantity))/sum (case when isnull(T2.[AvgPrice],0)= 0 then 1 else isnull(T2.[AvgPrice],0) end * T0.[Quantity])*100 AS [GP%]
    FROM ITT1 T0  INNER JOIN OITT T1 ON T0.Father = T1.Code INNER JOIN OITM T2 ON T0.Code = T2.ItemCode INNER JOIN ITM1 T3 ON T1.Code = T3.ItemCode
    WHERE (T1.[TreeType] = 'P' or  T1.[TreeType] = 's') and  T3.[PriceList] = 1
    GROUP BY T0.[Father],T3.[Price]}

  • Error While Generating Business query in Mobile Application Studio

    Hi,
    I made changes to the Business query BSOPPBPQUERY according to the SAP NOTES.
    Now I am trying to generate the business Query but it is giving out the error saying
    Error intializing RT Generator !.RT Generator Failed for ".Error arsrep.dat is in use so Generation cannot be done
    I am not a MSA Developer and have no clue regarding MAS(Mobile Application Studio)
    So any one can please give me a clue regarding the issue

    Hi Michael,
    I made some changes to the property of the business Object BOCAPGEN in dev MAS environment and generated the application
    It is working fine in Dev.
    Now i want to know how to transfer the changes i Made in Mobile Applicaiton Studio to all the Mobile Cleint.
    I made changes to MAS in the Test Client Assisgned to me.
    I want to replicate these chages to all the Clients.
    I am also having problem transporting the changes made in Dev to QA.
    I created the change list in Dev and released it and assigned the Transport Number to it..
    When I am trying to trasnport the transport number to QA in CRM online system it is giving out error saying "Change List is not complete in the system".
    Can you give me suggestiosn how to transport the change request created in Mobile Applicaiton Studio to QA

  • How to get all rows that are returned in inner sub query of select statemen

    If a sub query in select statement returns more than one row than how to get all those returned rows in the final
    output of the query .It will be all right if all column's value repeat and that multiple output of inner query comes
    in another column .
    How to get that ?

    As Frank said, you likely want a join, and likely an outer join to replicate the select in the projection. Something like:
    SELECT id,stat, section, USER_ID concerned_person
    FROM table_all,
      left join table2
        on room_id = sectoion and
           sur_role = 'r001'
    WHERE section IN (SELECT code
                      FROM t_area
                      WHERE dept= 'p002')An alternative, depending on where and how you are using the statement would be something like:
    SQL> WITH t AS (
      2    select 1 id from dual union all
      3    select 2 id from dual),
      4  t1 as (
      5    select 1 id, 'One' descr from dual union all
      6    select 1, 'Un' from dual union all
      7    select 1, 'Une' from dual)
      8  SELECT t.id, CURSOR(SELECT t1.id, t1.descr from t1
      9                      WHERE t1.id = t.id)
    10  FROM t;
                      ID CURSOR(SELECTT1.ID,T
                       1 CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
                      ID DESCR
                       1 One
                       1 Un
                       1 Une
                       2 CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
    no rows selectedJohn

  • Query to mimic the items tab of the Sales Analysis report.

    Hi there,
    I'm currently looking to create a query that mimics the behaviour of the Sales Analysis report in B1. The items tab of the Sales Analysis report provides all the data I require - the only issue is that I would like to merge this data with some other data regarding current on hand stock quantities etc. and therefore I would like to be able to pull out the query behind the Sales Analysis report.
    I'm assuming this cannot be done and therefore I'm attempting to build a query to replicate the results. The query needs to show Item No, Item Description, Quantity Sold, Sales Amt (in system currency), Gross Profit and Gross Profit % for items within a given period.
    If this can be done relatively easily, can the query then be modified to show all items (including items that haven't sold in the date range) merely with '0' for Quantity Sold, Sales Amt etc. if the item hasn't been sold in the period, and the appropriate figures if each of these columns if the item has sold. I assume some kind of CASE statement can be used to generate this.
    So the query needs to show Item No, Item Description, Current quantity in stock, Quantity Sold, Sales Amt (in system currency), Gross Profit and Gross Profit % for all items within a given date range.
    I hope you can assist me with this problem.
    Thanks
    Grant.

    Hi,
    Thanks Gordon that was exactly what I needed.
    I've been trying to add some additional columns to the query but I'm experiencing some errors and I can't quite tell why.
    Basically, here's the code from another working query I have which I wish to merge into the query you've suggested above:
    SELECT T0.[ItemCode],
    T0.[ItemName],
    T3.[ItmsGrpNam],
    T4.[Name] AS [Sub-Category],
    T5.[Name] AS [Sub-Sub-Category],
    T0.[CardCode] AS [Pref Supplier],
    T6.[FirmName] AS [Brand],
    T0.[U_Range],
    T0.[OnHand],
    CASE WHEN T0.[StockValue] = 0 THEN 0 ELSE T0.[StockValue] END AS [StockValue],
    T1.[Price] AS [PBK GBP Price],
    CASE WHEN T0.[OnHand] = 0 THEN T0.[LastPurPrc] ELSE T0.[StockValue]/T0.[OnHand] END AS [Ave Cost],
    CASE WHEN T0.[OnHand] = 0 THEN T1.[Price]-T0.[LastPurPrc] ELSE CASE WHEN T0.[OnHand] > 0 THEN T1.[Price]-T0.[StockValue]/T0.[OnHand] END END AS [Margin],
    CASE WHEN T0.[OnHand] = 0 AND T0.[LastPurPrc] = 0 THEN 0 ELSE CASE WHEN T0.[OnHand] > 0 AND (T0.[StockValue]/T0.[OnHand]) = 0 THEN 0 ELSE CASE WHEN T0.[OnHand] = 0 THEN (T1.[Price]-T0.[LastPurPrc])/T1.[Price]*100 ELSE CASE WHEN T0.[OnHand] > 0 THEN (T1.[Price]-T0.[StockValue]/T0.[OnHand])/T1.[Price]*100 END END END END AS [Margin %],
    T0.[LastPurPrc]
    FROM [dbo].[OITM]  T0 INNER JOIN [dbo].[ITM1]  T1 ON T0.ItemCode = T1.ItemCode INNER JOIN [dbo].[OITB]  T3 ON T0.ItmsGrpCod = T3.ItmsGrpCod LEFT OUTER JOIN [dbo].[@U_SUBCATEGORY]  T4 ON T0.U_Subcategory = T4.Code LEFT OUTER JOIN [dbo].[@U_SUBSUBCATEGORY]  T5 ON T0.U_SubSubCategory = T5.Code INNER JOIN OMRC T6 ON T0.FirmCode = T6.FirmCode
    WHERE T0.[OnHand] >= 0 and T0.U_Range not in ('E','X')  
    ORDER BY T0.[ItemCode]
    Essentially I just wish to add the fields which are specified in the query above, but not in the query you've already suggested:
    SELECT T0.ItemCode,
    Max(T0.ItemName),
    Max(IsNull(T0.OnHand,0)) 'In Stock',
    SUM(IsNull(T1.Quantity,0)) 'Quantity',
    Sum(IsNull(T1.LineTotal,0)) 'Sales Amt',
    SUM(IsNull(T1.GrssProfit,0)) 'Gross Profit',
    Case WHEN Sum(Isnull(T1.LineTotal,0)) = 0 THEN 0 ELSE
    SUM(IsNUll(T1.GrssProfit,0))/Sum(Isnull(T1.LineTotal,0)) * 100 END 'Gross Profit %'
    FROM dbo.OITM T0
    LEFT JOIN dbo.INV1 T1 ON T1.ItemCode=T0.ItemCode
    LEFT JOIN dbo.OINV T2 ON T2.DocEntry=T1.DocEntry AND T2.DocDate Between [%0] AND [%1]
    GROUP BY T0.ItemCode
    I was hoping it would be fairly straight forward but so far I've had limited success.
    What am I missing here?
    Thanks in advance!

  • Do you allow query or view creation in QA and PRD?

    Do you allow queries, views and workbooks to be created in QA or PRD?  If so, do you transport those BEx Objects into the other systems (e.g. PRD->QA and PRD->DEV or QA->PRD and QA->DEV)?
    Often I find I will be creating a query or a view in QA or PRD because those systems happen to have the data I am required to analyze.  DEV does not always have the data available.  But how do I move this BEx object to the other systems?
    This happens most often to views of a query, but also applies to queries, workbooks etc.  Like changing a workbook already transported to production.
    Thanks for your input.

    Hi Peter,
    In our system we (developers) are allowed to create / modify queries in the QA and Prd system. We do not actually 'develop' here, but we have this access for the reason you mention (data availability). The main query development is carried on in the Dev system and transported up, but the change access lets us to quickly solve issues many times. If we do put in a change in teh query, we replicate the change made in the dev system and transport it...no reverse transports are set up in the system.
    Hope this helps...

  • Sales Order + Activity query

    Hi,
    I set up the following query in one company:
    SELECT T0.DocNum, T1.ClgCode, T3.U_NAME, T2.name, T1.endDate, T1.Priority, T0.CardCode, T0.CardName, T0.NumAtCard, T0.DocDate, T0.DocTotal
    FROM ORDR T0 LEFT OUTER JOIN OCLG T1 ON T0.DocNum = T1.DocNum LEFT OUTER JOIN OCLA T2 ON T1.status = T2.statusID LEFT OUTER JOIN OUSR T3 ON T1.AttendUser = T3.INTERNAL_K
    WHERE T0.DocStatus = 'O'
    When I replicate it in another company, I get the following error:
    SQL Server Native Client 10.0|| SQL Server||  Conversion failed when converting the nvarchar value 'STBs-EN-0002' to data type int. 'Received Alerts' (OAIB)
    The STBs value indicated is an Item Code/IMD record which isn't even referred to in the query so not sure why it's getting picked up and/or causing an error.
    When I separate the two parts of the query - one query on just open sales orders, another on activities - they both work. It seems to be with the linking of ORDR to the Activities tables (if I try just ORDR and OCLG I get the same error above).
    Any assistance on figuring out how to fix the query would be much appreciated,
    Heather

    Hi Heather,
    Try:
    SELECT T0.DocNum, T1.ClgCode, T3.U_NAME, T2.name, T1.endDate, T1.Priority,
    T0.CardCode, T0.CardName, T0.NumAtCard, T0.DocDate, T0.DocTotal
    FROM ORDR T0
    LEFT JOIN OCLG T1 ON T0.DocNum = T1.DocNum AND T1.DocType = '17'
    LEFT JOIN OCLA T2 ON T1.status = T2.statusID
    LEFT JOIN OUSR T3 ON T1.AttendUser = T3.INTERNAL_K
    WHERE T0.DocStatus = 'O'
    Thanks,
    Gordon

  • Input ready query and display only rows

    I am trying to replicate scenario which is equivalent to creating manual layout in SEM-BPS with settings for layout category - Key Figures in Data columns, and rows defined individually.  In this version it is possible to restrict certain rows as comparision only.
    How can I acheive this using Input ready query? In my query I have created a strucure for Planning Items, but I am not able to show certain planning item selections as display only.
    Any thoughts?

    Hello Gregor,
    Thanks for you answer.
    I already have two structures as mentioned by you.
    Can you please let me know what exactly you meant by set the input flag on the cell level? What settings I have to change to set the flag, do I have to use any formula?  In my example I have three rows for Planning item row structure and I want only one row to be selected as display only row. 
    Regards,
    Sachin

  • Table RSZCOMPDIR in a Query

    Hello
    The Informations provided by the Table RSZCOMPDIR are very usefull for me.
    Can anybody give me some hinds, how i can use this table in a query.
    What kind of InfoProfider di I need.....
    Thanks

    Why do you want to use it in a query? Do you mean you want to do a query on its content? Then you need to do the following:
    1. Create a generic data source based on RSZCOMPDIR.
    2. Replicate it as 3.X data source.
    3. Create a fitting Info Source and transfer rule.
    4. Create a VirtualProvider based on the InfoSource and build a query.
    Best regards
    Dirk

  • How can I architect my data layer to yield query result pages to the application as SQL Server prepares them?

    I tried to make the question as explicit as possible.
    Refer to Sql Server Management Studio's Results view.  Depending upon the structure of the execution plan, the Results pane may begin displaying results while the query is still executing.  Can someone point me in a direction for architecting a
    data layer (I am tech and framework agnostic for this task. Any solution will suffice) that will begin receiving pages of the set before SQL Server has completed the entire query?
    The call from the data layer to SQL Server will obviously have to be asynchronous, but is there any additional ceremony that I need to be aware of when issuing OPTION (FAST x) to the query optimizer?

    Thanks for the reply. (I actually meant to put this in the SQL Data Access forum, not the T-SQL forum)
    "Generally the last step is ORDER BY in a
    query, so nothing can start before that executes."
    I would imagine you cannot ORDER BY and yield results as they are fetched because of the execution plan that would be generated.  For the purposes of this post, please assume that sorting will be done purely client side
    "Can you post your query?"
     For purposes of discussion, let's assume that the query is
    select *
    from information_schema.columns
    and also assume that you have "lots" of columns to display.
    This was an exploratory question to see what would be necessary to replicate the behavior of Management Studio's Query Result view in a custom application. 
    I would imagine that there's going to be a lot of analysis of the execution plans that get generated in order for the OPTION (FAST x) optimizer hint to do any good, but apart from general tuning concerns that would allow SQL SERVER to yield a page of data
    "fast", I was wondering if there was anything else required of the calling client to force it to yield return its first page.
    After thinking about this (and phrasing it the way I did in the last sentence) perhaps this is the incorrect forum for this question.  I imagine that my concerns are better addressed in forums dedicated to the technology of the calling client (which
    would be a .NET assembly)
    Be that as it may, if there is any ceremony that SQL Server imposes on clients in order to yield return, I would expect that my question would be in the scope of SQL Server discussions (even though I intended this to be in a different SQL Server forum)

  • Error when querying a table through the Query Window

    I am running a query on the following table in the ODT Query window - for some reason I get the error below when trying to retrieve the data - I can query the table just fine through SQL Plus - it errors out whether I use grid or text window
    ERROR
    Arithmetic operation resulted in an overflow.
    CREATE TABLE "RF3_PROD_1"."F_EXTRACTMETRICS" ("EXTRACT_NAME" VARCHAR2(50) NOT NULL,"RUN_START_DATE" DATE NOT NULL,"RUN_END_DATE" DATE NOT NULL,"DURATION" NUMBER DEFAULT 0 NOT NULL,"EXTRACT_START_DATE" DATE NULL,"EXTRACT_END_DATE" DATE NULL,"NUM_RECS_ADDED" NUMBER DEFAULT 0 NOT NULL,"NUM_RECS_DELETED" NUMBER DEFAULT 0 NOT NULL,"STATUS" VARCHAR2(50) NOT NULL,"COMMENTS" VARCHAR2(500) NULL) TABLESPACE "EXTRACT_TAB_01_TS" PCTFREE 15 PCTUSED 75 INITRANS 1 MAXTRANS 255 STORAGE ( FREELISTS 1 FREELIST GROUPS 1 INITIAL 8388608 NEXT 516096 MAXEXTENTS 2147483645 MINEXTENTS 1 PCTINCREASE 0 )
    I would have formatted it nicer - but that is the way that ODT created it :)

    Christian,
    I found that this happens when trying to query number fields that are reals with a large decimal value (26 decimal values and above seem to be the magic number). What is strange is that I don't get this problem when I retrieve data from the same table using the Retrieve data option (versus a query for all the data in the Query Window) so they don't seem to be utilizing the same basic code to grab and then display the data interestingly enough (I am sure you knew that). Does this allow you to replicate the issue?
    Thanks,
    Bryan

  • Unable to replicate data to BI using LO Extraction

    Hi,
    I unable to replicate from ECC(LO Extraction)the data...when i replicate the data from ECC i got some of the folling the data sources...
    80BPARTNERH 80BPARTNERH Change BI7CLNT001
    80PLANTH 80PLANTH Change BI7CLNT001
    Aggregated Status for Area of Responsibility 80RSPL_AST Change BI7CLNT001
    Assigned Selections for Areas of Responsibility 80RSPL_SEL Change BI7CLNT001
    Assigned Selections for Planning Sessions 80RSPL_SPS Change BI7CLNT001
    BI Trace Tool - End Analysis (Error Assignment) 80RSTT_O03 Change BI7CLNT001
    BI Trace Tool - Header Data for Test Logs (Transactional) 80RSTT_O01 Change BI7CLNT001
    BI Trace-Tool - Tested Functions 80RSTT_O02 Change BI7CLNT001
    Business Partner 80BPARTNERM Change BI7CLNT001
    Business Partner 80BPARTNERT Change BI7CLNT001
    Current Status for Area of Responsibility 80RSPL_CST Change BI7CLNT001
    Lock Management 80RSPL_LCK Change BI7CLNT001
    Person 80PERSONM Change BI7CLNT001
    Person 80PERSONT Change BI7CLNT001
    Plan. Session Status 80RSPL_PSS Change BI7CLNT001
    Planning Calendar 80RSPL_PLC Change BI7CLNT001
    Plant 80PLANTM Change BI7CLNT001
    Plant 80PLANTT Change BI7CLNT001
    Processor of Areas of Responsibility 80RSPL_AGS Change BI7CLNT001
    Status History for Area of Responsibility 80RSPL_HST Change BI7CLNT001
    Test 8TEST Change BI7CLNT001
    Trace Tool Reporting: Active Errors 80RSTT_O10 Change BI7CLNT001
    Trace Tool Reporting: InfoProvider-InfoObject Relationship 80RSTT_O07 Change BI7CLNT001
    Trace Tool Reporting: MultiProvider-PartProvider Relatnship 80RSTT_O08 Change BI7CLNT001
    Trace Tool Reporting: Test Assignments to Test Packages 80RSTT_O09 Change BI7CLNT001
    Trace-Tool Reporting: Query-Trace Relationship 80RSTT_O04 Change BI7CLNT001
    Trace-Tool Reporting: Verification Detail 80RSTT_O06 Change BI7CLNT001
    Trace-Tool Reporting: Verification Results 80RSTT_O05 Change BI7CLNT001
    I unable to get the SAP Applicating component..Wht should i do..Plz help me....
    and another Question...
    This is previous thread ...When i replicate the data source(2lis_11_vahdr)..its telling
    Data Source (OSOA) OFS_BP_TREASURY_ATTR does not exist in BI system How do u want to create the object in BI
    There r 4 options..like
    as Datasource (RSDS)
    as 3.x Datasource (ISFS)
    this and following 9 as Datasource (RSDS)
    this and following 9 as 3.x Datasource (ISFS)
    I choose as Datasource(RSDS)...
    Which one i need to Check....
    But When i replicate the data it does showed application component...
    Wht should i do..
    Thanks
    Gopi

    Thanks for ur Reply..
    Iknow that wht u told..But even replicate the data in BI i didn't find the SAP APPLICATION COMPONENT..Option in BI..
    I have two logical systems...T90 client is not working...another is working....I couldn't find the SAP APPLICATION COMPONENT in this client...Plz tell me..
    I know how to replicate the concept....
    in that client... i have only the folling Datasources... only
    80BPARTNERH 80BPARTNERH Change BI7CLNT001 80PLANTH 80PLANTH Change BI7CLNT001 Aggregated Status for Area of Responsibility 80RSPL_AST Change BI7CLNT001 Assigned Selections for Areas of Responsibility 80RSPL_SEL Change BI7CLNT001 Assigned Selections for Planning Sessions 80RSPL_SPS Change BI7CLNT001 BI Trace Tool - End Analysis (Error Assignment) 80RSTT_O03 Change BI7CLNT001 BI Trace Tool - Header Data for Test Logs (Transactional) 80RSTT_O01 Change BI7CLNT001 BI Trace-Tool - Tested Functions 80RSTT_O02 Change BI7CLNT001 Business Partner 80BPARTNERM Change BI7CLNT001 Business Partner 80BPARTNERT Change BI7CLNT001 Current Status for Area of Responsibility 80RSPL_CST Change BI7CLNT001 Lock Management 80RSPL_LCK Change BI7CLNT001 Person 80PERSONM Change BI7CLNT001 Person 80PERSONT Change BI7CLNT001 Plan. Session Status 80RSPL_PSS Change BI7CLNT001 Planning Calendar 80RSPL_PLC Change BI7CLNT001 Plant 80PLANTM Change BI7CLNT001 Plant 80PLANTT Change BI7CLNT001 Processor of Areas of Responsibility 80RSPL_AGS Change BI7CLNT001 Status History for Area of Responsibility 80RSPL_HST Change BI7CLNT001 Test 8TEST Change BI7CLNT001 Trace Tool Reporting: Active Errors 80RSTT_O10 Change BI7CLNT001 Trace Tool Reporting: InfoProvider-InfoObject Relationship 80RSTT_O07 Change BI7CLNT001 Trace Tool Reporting: MultiProvider-PartProvider Relatnship 80RSTT_O08 Change BI7CLNT001 Trace Tool Reporting: Test Assignments to Test Packages 80RSTT_O09 Change BI7CLNT001 Trace-Tool Reporting: Query-Trace Relationship 80RSTT_O04 Change BI7CLNT001 Trace-Tool Reporting: Verification Detail 80RSTT_O06 Change BI7CLNT001 Trace-Tool Reporting: Verification Results 80RSTT_O05 Change BI7CLNT001.
    Other than that i couldn't get the another Datasources...Even i replicate...
    Waiting ur reply
    Thanks
    Gopi

  • Issue while extracting data using Gen DS of Type Infoset Query

    Hi All,
    We have a Generic Data source created using the Infoset query. I get some data discrepency when i am extracting the data with the same DS. The data for the Field Amount in the R3 and the PSA  is different. When i try to check the same using the RSA3 T-Code i am unable to execute the Gen DS in R3 production where as its working fine in R3 Dev, and i am able to execute the other DS in the R3 production using the RSA3 T-code.
    My concerns ::--
    1. if the DS is working fine in R3 Dev in RSA3 the y i am facing the problem in Production.
    2. Y i am getting the different data in R3 and PSA since PSA shuld be the replicate of R3?
    3. How can i resolve this problem.??
    Thanks in Advance
    Regards

    Thanks venkat,
    I am having the authorization to execute the query in R3 production, As  i am able to execute the other DS in RSA3 . But not able to execute this DS i had also checked it is active n working fine when loading the Data.
    There is only one routine ie to transfer rule  from lower to upper of a char value.
    As der r routines in Update Rule but i have to get the same data in PSA which is der in R3.
    The Routine of Update Rules will be executed when loading the data to the Targets right so the data may b vary in Data targets but y i am getting different data in PSA .
    Pls thru some light.
    Regards

  • How to manage Locale info in the URL path, but not the query string

    We are building an application using Struts 1.1 and Tiles, on Oracle Application Server 10.1.3.3...
    I know this is a strange question... but we have a requirement to represent the locale info in the URL string using one of the following options:
    option 1: /eng/page.do?id=2 for english.../fra/page.do?id=2
    option 2: /page-eng.do?id=2 for english.... and /page-fra.do?id=2 for french
    We need to represent the 3 letter ISO lang code either in the directory structure, or suffix the page name (in our case, the struts action name)... we cannot replicate this using a parameter in the query string. I know this is odd, but that is what we are told to implement.
    Is there any robust way of implementing either option in Struts 1.1, JSP, JSTL etc...?
    Currently, we are looking at using a servlet filter to intercept the HTTP requests, parse the URL string, and extract the ISO lang value, and set locale and forward on the request.
    This poses a few problems... adding additional action mappings (page-eng... page-fra... page) to our struts-xml.config file to handle lang permuations... but the biggest issue is all the embedded html:link action values throughout our code...
    Because all our public facing URLs must comply with the rule, we need to change the html:link action to point to a different action, based on locale.
    Very inefficent, and I'm sure not industry standard best practice... we are using Tiles, and resource bundles for all our labels etc... but fall short in meeting this rule with regards to URLs and locale.
    Any advice or tips etc.. is greatly appreciated.

    The filter option sounds like a good solution. So it can receive the urls and parse them appropriately.
    You just need to take it one step further.
    Additional actionmappings in your struts-config should not be necessary.
    Filter:
    - analyses the url and sets the appropriate locale
    - adjusts the url such that the next level of the chain does not have to know anything about the locale being encoded in the url string.
    Thus your struts classes and mappings can remain unchanged
    /eng/page.do or /fra/page.do once through the filter should just look like /page.do to struts.
    That should get rid of half of your headache.
    Next the issue of generating urls.
    There are two approaches I can see here
    1 - use the filter approach again, this time with some post processing. Gather the generated HTML in a buffer, and do a find/replace on any urls generated, to put the locale encoding into them.
    2 - Customise struts to produce urls in this format. This would involve the html:link tag, and the html:form tag at the least (maybe others?). Get the source code for struts, and grab the html:link tag code. Extend that class to generate urls as you want them to be generated. I think you would need to extend the class org.apache.struts.taglib.html.LinkTag and override the protected method calculateURL. You would then have to edit/modify the struts-html tld to point the link tag at your classes rather than the standard ones.
    Option 1 is architecturally good because it gives you a well defined layer/border between having the locale encoded in the url, and not having it there. However it involves doing a find/replace on every html going out. This would catch all urls, whether generated by html:link tag or not.
    Option 2 requires customising struts for your own requirements, which may be a bit daunting, but has the advantage of generating the urls correctly without the extra overhead involved with option 1. Of course you would have to ensure that ALL urls are generated with the html:link tag.
    On reflection, I think option 1 is preferable, as both easier and quicker to implement, and doing a better separation in the architecture.
    Cheers,
    evnafets

  • Need query to find out whether exactly 2 columns are used in any index ?

    Suppose i have two columns ID and Status (or any number of columns ) belongs to table customer...
    Now I want to create below index
    Ex. create index test1 on customer (ID , Status )
    But before creating this index i want to check that whether there is already index on these 2 columns ? May be by other name ?
    Need query for this.
    Plz help.

    Hi Shubhangi,
    Your requirement is very difficult to fulfill , i have made an attempt to replicate your reqrmnt & write a query wherein you need to compromise on few things , let us see if it works for you
    Supply table_name/owner & Number of column on which you want to find indexes
    e.g.
    select distinct INDEX_NAME,column_name
    from dba_ind_columns
    where index_name in (select distinct index_name
    from dba_ind_columns
    where table_name='&table_name'
    and table_owner='&owner'
    having count(column_name)=&column_count group by index_name);
    Enter value for table_name: ADDRESS
    Enter value for owner: ASAP
    Enter value for column_count: 2
    INDEX_NAME COLUMN_NAME
    FKIDX_AD__SF_ST_FO SF_STRUC_FORMAT_NM
    FKIDX_AD__SF_ST_FO SF_TYPE_NM
    SQL> /
    Enter value for table_name: ADDRESS
    Enter value for owner: ASAP
    Enter value for column_count: 3
    INDEX_NAME COLUMN_NAME
    FKIDX_AD__SF_ST_FO_1 POSTAL_CD
    FKIDX_AD__SF_ST_FO_1 SF_STRUC_FORMAT_NM
    FKIDX_AD__SF_ST_FO_1 SF_TYPE_NM
    Thanks,
    Ajay More
    http://moreajays.blogspot.com

Maybe you are looking for

  • What to do with a defective NEW iPhone 5c?

    Hi Guys I just recently purchased an iPhone 5C - it was shipped to me October 1. And I immediately knew I was sent a defective unit. First and foremost, the button is not working--the only way I've been able to navigate it is throught the assistive t

  • Which MacBook Pro under $2000 for FCPX & Motion 5?

    I am selling my late 2011 13'' MBP MD313LL/A tomorrow. Looking to get the most powerful MBP that will handle FCP X & Motion 5 the best for under two thousand dollars. I have found a new mid 2011 MBP 15'' with i7, 750 GB 7,200rpm, anti-glare screen fo

  • Service Tax Standar Configuration for TAXINN

    Dear Gurus, Can anybody will provide the standar configaration document with details for Service Tax.  ( We will set-off 100% Service tax against Excise) Thanx inadvance. Regards, Venkat

  • Easy question: Limit message size from any channel

    Greetings Jay and SUNWmsgsr gurus, Seems like a long time since I've posted in this forum. That's because things are working great! Anyway, I have a need to limit the message size for both outbound and incoming to 20MB. I added sourceblocklimit 20000

  • Buffer Tuning in ST02 Recommendations

    I am looking for some advice as to how to change tune my buffers in our application servers.  Their current settings are based off of SAP’s, pre go-live checks.  But to me they seem to need some adjusting. Our server has 8GB’s of RAM, so I feel like