Pass dynamic parameter to Struts' forward

In my application, when a user modifies a particular record from the database, after they edit it and save it, I want to show them the modified record.
I'm using struts, however, I don't know how to pass the recordID to the struts forward after it has been saved.
Here is my struts-config.xml
<action path="/saveEquipmentTemplate"
         type="cafe.struts.actions.SaveEquipmentTemplateAction"
         name="equipmentTemplateForm"
         input="saveequipmenttemplate.input"
         scope="request">
         <forward name="saveequipmenttemplate.success"
         redirect="true"
         path="/showEquipmentTemplate.do" />
</action>What I would like is something like this:
<forward name="saveequipmenttemplate.success"
         redirect="true"
         path="/showEquipmentTemplate.do?recordID=XXX" />Where XXX is the recordID that was just modified.
To recap, how do I pass a dynamic parameter to an action forward in struts?

The following kludge works for me:
public ActionForward execute(ActionMapping mapping, ActionForm actionForm,
    HttpServletRequest request, HttpServletResponse response )
    throws IOException, ServletException {
    // select the view
    ActionForward actionForward = mapping.findForward("foo.bar");
    ActionForward newActionForward = new ActionForward(actionForward);
    newActionForward.setPath(actionForward.getPath() + "?id=" + id);
    return newActionForward;
  }

Similar Messages

  • Pass Dynamic Parameter to Agent

    Hi All,
    I am trying to send the report/analyses by mail to my leaders in Oracle Business Intelligence 11.1.1.5.0.
    My report has Dashboard prompt for Region like "North" , "South", "East" and "West".
    I am able to send the report for all region but not able to send 4 reports for each region .
    How can i do it in Oracle Business Intelligence 11.1.1.5.0.?
    Do i need to use OBIEE Publisher for passing dynamic parameter .
    Thanks
    Nawneet

    The following kludge works for me:
    public ActionForward execute(ActionMapping mapping, ActionForm actionForm,
        HttpServletRequest request, HttpServletResponse response )
        throws IOException, ServletException {
        // select the view
        ActionForward actionForward = mapping.findForward("foo.bar");
        ActionForward newActionForward = new ActionForward(actionForward);
        newActionForward.setPath(actionForward.getPath() + "?id=" + id);
        return newActionForward;
      }

  • How to pass dynamic parameter to a database function in OBIEE

    Hi,
    I have a requirement like this. I have to create one report in OBIEE which was in Discoverer. Now in discoverer report there are some calculated item in the worksheet based on database pkg.functions. The parameter which user gives at run time that parameters are then passed to the discoverer calculated items dynamically. But I am not able to do this in OBIEE answers.
    Can anyone tell me step by step how I can able to pass the user selected parameter values in OBIEE answer level.
    The example:
    GET_COMM_VALUE_PTD("AFE Cost & Commitment".Afe Id,:"Period Name(AFE)","AFE Cost & Commitment".Data Sel,"AFE Cost & Commitment".Org Id)
    GET_COMM_VALUE_PTD --- Function database
    ("AFE Cost & Commitment".Afe Id,:"Period Name(AFE)","AFE Cost & Commitment".Data Sel,"AFE Cost & Commitment".Org Id --- Parameters... :"Period Name(AFE)" is the dynamic parameter selected run time by user.
    Please help.
    Thanks
    Titas

    Hi,
    I already did that. But the existing discoverer re value report is showing correct value but the OBIEE report with EVALUATE function shows incorrect value.
    The requirement is to create a OBIEE Dashboard from a Discoverer existing report. Now in discoverer report theere are several calculated items in worksheet level where database custom function is used and user selected parameter value is passed run time in that function. But when that is created in OBIEE with EVALUATE function in RPD, the report shows incorrect data. Could not understand how to pass the parameter value runtime.
    Below is the discoverer 'Show SQL' query and EVALUATE function syntax which has been used.
    SELECT APPS.XXBG_PL_PROJ_ANALYSIS_AFE_PKG.GET_COMM_VALUE_PTD(XXBG_PL_PROJ_AFE_V.AFE_ID,
    :"Period Name(AFE)",
    XXBG_PL_PROJ_AFE_V.DATA_SEL,
    XXBG_PL_PROJ_AFE_V.ORG_ID),
    XXBG_PL_PROJ_AFE_V.AFE_DESC,
    XXBG_PL_PROJ_AFE_V.AFE_NUMBER,
    XXBG_PL_PROJ_AFE_V.APPROVED_AFE_AMOUNT
    FROM APPS.PA_PERIODS_ALL PA_PERIODS_ALL,
    APPS.XXBG_PL_PROJ_AFE_V XXBG_PL_PROJ_AFE_V
    WHERE ((XXBG_PL_PROJ_AFE_V.ORG_ID = PA_PERIODS_ALL.ORG_ID))
    AND (XXBG_PL_PROJ_AFE_V.DATA_SEL = :"Data Selection(AFE)")
    AND (PA_PERIODS_ALL.PERIOD_NAME = :"Period Name(AFE)")
    AND (XXBG_PL_PROJ_AFE_V.AFE_NUMBER = :"AFE Number(AFE)")
    AND (XXBG_PL_PROJ_AFE_V.OPERATING_UNIT = :"Operating Unit(AFE)")
    The EVALUATE function syntax is as below:
    EVALUATE('XXBG_PL_PROJ_ANALYSIS_AFE_PKG.GET_COMM_VALUE_PTD(%1,%2,%3,%4)' AS FLOAT , "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Afe Id", "BG PL Project Analysis Report_1"."Periods 1"."Periods 1.Period Name", "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Data Sel", "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Org Id")
    The PERIOD needs to be passed at run time which user will select.
    Please help to solve the issue.

  • Sub Query Error When Passing Dynamic Parameter.

    Dear All, I need help for below query problem.
    I have try below query run no problem when pass a static Parameter into the query but it throw error once i have add in the dynamic parameter:-
    --Sales BatchNum Transaction
    SELECT T0.[ItemCode], T0.[ItemName], T0.[WhsCode], T0.[BatchNum], ISNULL(T4.[AvgPrice],0) AS 'Avg Price', SUM(T0.[Quantity]) AS 'Sales Quantity',
    (SELECT [Quantity] FROM [OIBT] T1 WHERE T1.[ItemCode] = T0.[ItemCode] AND T1.[WhsCode] = T0.[WhsCode] AND T1.[BatchNum]=T0.[BatchNum]) AS 'Stock OnHand'
    FROM [IBT1] T0 INNER JOIN [OITM] T2 ON T0.[ItemCode] = T2.[ItemCode]
                      INNER JOIN [OITB] T3 ON T2.[ItmsGrpCod] = T3.[ItmsGrpCod]
                      INNER JOIN [OITW] T4 ON T0.[ItemCode] = T4.[ItemCode] AND T0.[WhsCode] = T4.[WhsCode]
    WHERE T0.[BaseType] = [%0] AND T0.[DocDate] BETWEEN [%1] AND [%2] AND T3.[ItmsGrpNam] = [%3]
    GROUP BY T0.[ItemCode], T0.[ItemName], T0.[WhsCode], T0.[BatchNum], T4.[AvgPrice]
    --ORDER BY T0.[ItemCode]
    UNION ALL
    --No Sales Batch Transaction
    SELECT T4.[ItemCode], T4.[ItemName],T4.[WhsCode], T4.[BatchNum], ISNULL(T7.[AvgPrice],0) AS 'Avg Price', 0 AS 'Sales Quantity' ,SUM(T4.[Quantity])
    FROM [OIBT] T4 INNER JOIN [OITM] T5 ON T4.[ItemCode] = T5.[ItemCode]
                      INNER JOIN [OITB] T6 ON T5.[ItmsGrpCod] = T6.[ItmsGrpCod]
                      INNER JOIN [OITW] T7 ON T4.[ItemCode] = T7.[ItemCode] AND T4.[WhsCode] = T7.[WhsCode]
    WHERE NOT EXISTS
    ( SELECT T0.[ItemCode], T0.[ItemName], T0.[WhsCode], T0.[BatchNum], ISNULL(T5.[AvgPrice],0) AS 'Avg Price', SUM(T0.[Quantity]) AS 'Sales Quantity'
      FROM [IBT1] T0 INNER JOIN [OITM] T2 ON T0.[ItemCode] = T2.[ItemCode]
                        INNER JOIN [OITB] T3 ON T2.[ItmsGrpCod] = T3.[ItmsGrpCod]
                         INNER JOIN [OITW] T5 ON T0.[ItemCode] = T5.[ItemCode] AND T0.[WhsCode] = T5.[WhsCode]
      WHERE T0.[BaseType] = [%1] AND T0.[DocDate] BETWEEN [%1] AND [%2] AND T4.[ItemCode]=T0.[ItemCode] AND T4.[WhsCode]=T0.[WhsCode] AND T4.[BatchNum]=t0.[BatchNum] AND T3.[ItmsGrpNam] = [%3]
      GROUP BY T0.[ItemCode], T0.[ItemName], T0.[WhsCode], T0.[BatchNum],T5.[AvgPrice]
    AND T6.[ItmsGrpNam] = [%3]
    GROUP BY T4.[ItemCode], T4.[ItemName], T4.[WhsCode], T4.[BatchNum], T7.[AvgPrice]
    HAVING SUM(T4.[Quantity]) > 0
    ORDER BY 1, 2, 3, 5 DESC
    I think SAP Query Manager can support the sub-query, kindly advise how to solve or other alternative way to solve this issue.
    Thanks a lot.

    Dear  Thanga Raj K,
    From your solution i can get my expected result, only within your solution you miss out the @ in line 32 for ToDate variable.
    After i have added it, it working perfectly.
    Thanks once again.
    For other user References code(Corrected):-
    Declare @basetype as int
    Declare @FromDate as Datetime
    Declare @ToDate as Datetime
    Declare @ItemGroup as nvarchar(30)
    set @basetype = (select max(s0.BaseType) from IBT1 S0 where s0.BaseType = '[%0]')
    set @FromDate = (select min(S1.DocDate) from IBT1 S1 where S1.DocDate >= '[%1]')
    set @ToDate = (select max(S2.DocDate) from IBT1 S2 where S2.DocDate <= '[%2]')
    set @ItemGroup = (select max(S3.ItmsGrpNam) from OITB s3 where S3.ItmsGrpNam = '[%3]')
    --Sales BatchNum Transaction
    SELECT T0.ItemCode, T0.ItemName, T0.WhsCode, T0.BatchNum, ISNULL(T4.AvgPrice,0) AS 'Avg Price', SUM(T0.Quantity) AS 'Sales Quantity',
    (SELECT Quantity FROM OIBT T1 WHERE T1.ItemCode = T0.ItemCode AND T1.WhsCode = T0.WhsCode AND T1.BatchNum=T0.BatchNum) AS 'Stock OnHand'
    FROM IBT1 T0 INNER JOIN OITM T2 ON T0.ItemCode = T2.ItemCode
    INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
    INNER JOIN OITW T4 ON T0.ItemCode = T4.ItemCode AND T0.WhsCode = T4.WhsCode
    WHERE T0.BaseType = @basetype AND T0.DocDate BETWEEN @FromDate AND @ToDate AND T3.ItmsGrpNam = @ItemGroup
    GROUP BY T0.ItemCode, T0.ItemName, T0.WhsCode, T0.BatchNum, T4.AvgPrice
    --ORDER BY T0.ItemCode
    UNION ALL
    --No Sales Batch Transaction
    SELECT T4.ItemCode, T4.ItemName,T4.WhsCode, T4.BatchNum, ISNULL(T7.AvgPrice,0) AS 'Avg Price', 0 AS 'Sales Quantity' ,SUM(T4.Quantity)
    FROM OIBT T4 INNER JOIN OITM T5 ON T4.ItemCode = T5.ItemCode
    INNER JOIN OITB T6 ON T5.ItmsGrpCod = T6.ItmsGrpCod
    INNER JOIN OITW T7 ON T4.ItemCode = T7.ItemCode AND T4.WhsCode = T7.WhsCode
    WHERE NOT EXISTS
    (SELECT T0.ItemCode, T0.ItemName, T0.WhsCode, T0.BatchNum, ISNULL(T5.AvgPrice,0) AS 'Avg Price', SUM(T0.Quantity) AS 'Sales Quantity'
    FROM IBT1 T0 INNER JOIN OITM T2 ON T0.ItemCode = T2.ItemCode
    INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
    INNER JOIN OITW T5 ON T0.ItemCode = T5.ItemCode AND T0.WhsCode = T5.WhsCode
    WHERE T0.BaseType = @basetype AND T0.DocDate BETWEEN @FromDate AND @ToDate AND T4.ItemCode=T0.ItemCode AND T4.WhsCode=T0.WhsCode AND T4.BatchNum=t0.BatchNum AND T3.ItmsGrpNam = @ItemGroup
    GROUP BY T0.ItemCode, T0.ItemName, T0.WhsCode, T0.BatchNum,T5.AvgPrice
    AND T6.ItmsGrpNam = @ItemGroup
    GROUP BY T4.ItemCode, T4.ItemName, T4.WhsCode, T4.BatchNum, T7.AvgPrice
    HAVING SUM(T4.Quantity) > 0
    ORDER BY 1, 2, 3, 5 DESC

  • Passing Dynamic Parameter to URL

    Hi All,
    I have a Webdynpro Application, where I am calling a separate iView through a URL (Quick link to that iView) using a LinkToAction UI element.
    Now, we need to pass a parameter (say Part Number) to the external iView through our webdynpro application.
    The external iView when called should be filled with a value by default. This value has to be retreived on some parameter from the main application.
    Can anybody suggest how to achieve this? We are presently using a common URL, so when the external window opens the iView will be blank. But now we need that when the user navigates to the external window, it should appear with the corresponding value.
    How can we make the URL to pass dynamic parameters?
    Any suggestions on this will be appreciated.
    Thanks,
    Becky.

    Hi Becky,
    A Web Dynpro application can get URL parameters passed to the iView with the following code:
    WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter();
    You can send URL parameters to a Web Dynpro page in the following ways:
    ●      Add to the URL a parameter called DynamicParameter, whose value is a set of key-value pairs to send to the page.
    The following is the format for the DynamicParameter parameter:
    DynamicParameter="param1=value1&param2=value2&"&
    The value ("param1=value1&param2=value2&") must be URL encoded.
    ●      Add to the URL parameters that start with sap-.
    ●      Add parameters to the businessParameters parameter of the navigateAbsolute() or navigateRelative() method, as described in Absolute Navigation and Relative Navigation.
    iView Parameters
    The following are the URL parameters that get passed to each iView on the page, and then to the underlying Web Dynpro application:
    ·        The static parameters defined in the Application Parameters property for each iView. The property value is a set of key-value pairs in the following format:
    param1=value1&param2=value2&
    ·        The parameters passed to the page (those defined in the DynamicParameterparameter as well as all parameters starting with sap-).
    For isolated iViews in a Web Dynpro page, only the parameters specified in the Parameters to Pass from Page Request property for each iView are passed to that iView.
    The property value is a list of parameter names, separated by commas, as follows:
    param1,param2,param3
    To specify all parameters, enter an asterisk (*).
    We did same for one of the requirement in our project let us know if you have any issues.
    Regards
    Jeetendra

  • Passing dynamic parameter to stored procedure from CR formula?

    Dear all,
    I need to insert in some textboxes the right string based on the desired Language Code.
    I crated a stored procedure in my db.
    CREATE PROCEDURE MY_GET_TRANSLATION
         @TextID nvarchar(8),
         @LangCode int
    This parameters are used as keys to get the Trans field.
    I created a workshop formula: GetTranslation
    Please, can someone suggest the correct statement to call my MY_GET_TRANSLATION  stored procedure passing parameters?
    I would like to call the GetTranslation formula from all my textboxes, passing the specific TextID value
    and visualized the right translated string.
    For example:
    in my TEXT1 textbox, I would like to call the GetTranslation formula passing the parameters
    TextID = "T000001"
    and
    LangCode = 13    (Italian language)
    How can pass dynamic parameters to a formula?
    How can pass dynamic parameters to a stored procedure from a CR formula?
    Regards
        Emanuele

    Dear Jason,
    I'm trying to modify a SAP B1 CR marketing report.
    This CR marketing document is called by SAP B1 automatically passing the Document Number and Document Type.
    The report uses the right SAP B1 tables to read the information of the header and rows of the document.
    The language of the document is contained in a field of the header table
    {MyMarketingDocTable.LanguageID}
    I created a user table named "MyTranslationTable" where I added some strings in different langiages.
    For example:
    TexiID            TextString              LangID
    T00001          Delivery                          8      
    T00001          Consegna                     13       (Italian translation)
    T00002          Invoice                           8
    T00002          Fattura                         13       (Italian translation)
    In the header of the report I'd like, for example, to visualise the string "Consegna" if my document is a delivery in italian language.
    I'd like to implement this method to translate all the textboxes (header, comments, etc.) based on the languageID of my document.
    For each textboxes, in the CR designer statically I know what TextID I want to visualized but dinamically I need to pass to my stored procedure the right language. I'd like my report automatically gets the language at run-time. I don't want that when I press the Print-preview button in SAP B1, the report asks to prompt the languageID.
    It already read the DocNum and DocType and it already filter the SAP B1 tables basing on the DocNum and DocType of the document. In this way it reads the right row in the SAP B1 table and in this way I can read all the fields of this row (also the languageID of the actual document).
    Regards
        Emanuele
    Edited by: Emanuele Croci on Dec 3, 2010 9:03 AM

  • Passing dynamic parameter to BEx Web from Visual Composer application

    Hi Experts,
    I have got a table with brand name with hierarchy node,  brand key and when the user selects a row on the table it should display detail data on the BEx Web. To do this, I have done the following;
    - Added a button to the Action Toolbar of the Table
    - Added an HTML view to the design time as well as a Data Store
    - Created a field in the Data Store called u201Cselectionu201D
    - Map from the table containing the 'Select' button to both the Data Store and the HTML view
    - Used the custom action u201CSelectu201D to write a value u201C3u201D to the u201Cselectionu201D field of the DataStore
    - Set the system acion (Event Name) 'select' to set a URL for the HTML view
    - Set the URL Assinged Value = 'http://sapbid001:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?&QUERY=ZPIP_BACKORD_DETAILS&FILTER_IOBJNM=0CUST_GROUP&FILTER_NODE_IOBJNM=0HIER_NODE&FILTER_VALUE='&@Brand_key&''
    It opens the query ZPIP_BACKORD_DETAILS for all brands and it's passing right brand key to it as well. But the dilema is the query is not filtering according to the parameter passed to it.
    Could you please suggest me what steps I need to follow in order to resolve the issue?
    Thanks.

    Hello Bhai,
    Could you tell me how did you solve  your issue? because i would like to doing same things.. but filter doesnt work...
    Thanks in advance
    Rasim

  • Use bean to pass  dynamic parameter from one jspto another

    Hi Everyone
    I am trying to use a bean to pass parameter instead of passing param through querystring . This is the situation:
    in jsp1 I query a table and get the result listed, when I click every row of the record , I want some special parameters passed to jsp2 through bean, I found I can't get these param in jsp2 simply using getProperty method, It seems I must use form in jsp1 to activate jsp2 which use bean to pass param, Can I do it using linking archor? Because I don't want my params to list in the URL whem activate jsp2, I do not want to use the following format:
    <a href="ViewQueryDetail.jsp?string_num=<%=string_num %>&depart=<%=depart %>&l_time=<%=l_time %>&title=<%=encode_title %>  target="_top"><%=title%>
    If anybody had done this, kindly guide me.
    Thanks in advance.
    xufang</a>

    Thanks for your kindly reply, I followed your direction and now I get java.lang.NullPointerException when I link to jsp2. My code is here:
    jsp1:
    <%
    prjxnxx.db.BnParamDtxx MyBean = new prjxnxx.db.BnParamDtxx();
    prjxnxx.db.BnParamDtxx MyBean1 = new prjxnxx.db.BnParamDtxx();
    while(bean.next()) { %>
    <tr>
    <%!
    int conflag ;
    String depart ;
    String l_time;
    int dtnum ;
    String title ;
    String encode_title;
    String content ;
    //Object object_content ;
    %>
    <%
    conflag = bean.getDataInt("conflag");
    depart =bean.getDataString("depart");
    l_time =bean.getDataString("l_time");
    dtnum = bean.getDataInt("dtnum");
    //String string_num =String.valueOf(dtnum);
    title = bean.getDataString("title");
    //request.setAttribute("title",title);
    //request.setAttribute("depart",depart);
    //request.setAttribute("l_time",l_time);
    //request.setAttribute("dtnum",string_num);
    %>
    <%
    //if(request.getAttribute("MB")==null){
    MyBean.setDepart(depart);
    MyBean.setTitle(title);
    MyBean.setL_time(l_time);
    MyBean.setDtnum(dtnum);
    request.setAttribute("MB", MyBean);
    MyBean1 = (prjxnxx.db.BnParamDtxx)request.getAttribute("MB");
    depart = MyBean1.getDepart();
    title = MyBean1.getTitle();
    l_time = MyBean1.getL_time();
    dtnum = MyBean1.getDtnum();
    System.out.println(depart);
    System.out.println(title);
    jsp2:
    <%!
    String content ;
    int conflag ;
    String depart ;
    String l_time;
    int dtnum ;
    String title ;
    String query;
    %>
    <%
    prjxnxx.db.BnParamDtxx MyBean2 = new prjxnxx.db.BnParamDtxx();
    MyBean2 = (prjxnxx.db.BnParamDtxx)request.getAttribute("MB");
    depart = MyBean2.getDepart();
    title = MyBean2.getTitle();
    l_time = MyBean2.getL_time();
    dtnum = MyBean2.getDtnum();
    %>
    Everything is ok until I run the code
    MyBean2 = (prjxnxx.db.BnParamDtxx)request.getAttribute("MB");
    depart = MyBean2.getDepart();
    Can you explain why I can use getAttribute in jsp1 right yet not in jsp2?
    What is the difference between request.getAttribute and pagecontext.getRequest().getAttribute ?
    I am alway grateful for there are someone like you who can help person when they are in need!
    xufang

  • (Cont)Passing dynamic parameter with the URL while submitting the form

    Hi all,
    My question is based on this link --> http://forums.adobe.com/message/4942572#4942572
    May you kindly refer to the link above for reference.
    My question is suppose the client side have a html page with a url, when the user click on the link, how the adobe livecycle directly receive the link that clicked from the user? is it possible to do that? Please advise.
    Thanks a lot.

    please help....

  • Dynamic parameter passing through hyperlink in Cross tab report

    Hi,
    I have a requirement in which I have to create a hyper link to parent report (measures) the format of parent report looks like
    1. Left side   Dimensions                     
    2. Report header contains again with dimension     
    3. Body of the cross tab contains some details , dimensions and measures.
    Here  My requirement is to create a hyperlink on mesures (body) so that the corresponding left side dimension and dimension value in the header should go as input parameters to child report dynamically. The child report has two prompts . i.e both are dimensions and based on the input data from parent the child report displays the granular data.
    Can any one help me how to create a hyperlink to pass dynamic values on columns and not hardcoding values.
    Any help is highly aprreciated.
    Thanks in Advance,
    Suresh Aluri.

    Hi,
    I'm trying to do something very similar. I have a crosstab report with dimensions on the left (month/year) and on the header (ticket category). However, I'm having trouble passing the measure in the intersecting cell to a child report. This measure is created from the fact table and equates to a count of the tickets. However, it's not exactly 'select count(ticketID) from tablename' and I think that is part of my problem.
    In the child report (tabular), I'm passing the same month/year and category dimension values. However, I'm not sure how to pass the measures over. What I want is basically a detailed list of the ticket IDs in a tabular form.
    So for example, in the parent report, if there are 12 tickets listed under Jan 09 & category A; then I want the child report to list those 12 tickets.
    My problem is that I'm getting more than 16 instead of 12 records.
    Thanks in advance,
    Carter

  • How pass a parameter with forward slash to plsql script

    Hi,
    I am trying pass a parameter to plsql script from command line using sqlplus, and the parameter is a file directory and has '/'. Seems the system couldn't recognize the value.
    here is my code in DECLARE:
    l_FileDir VARCHAR2(200) := &&FileDir ;
    I pass value '/usr/tmp' (with the single quote in the string)
    Can someone tell me how I do it?
    Thanks,
    Kate
    Edited by: user12100435 on Feb 25, 2010 8:31 AM

    user12100435 wrote:
    I think you are right. The issue is not file-separator character issue. because the exact same script run in another envoironment. And it's not file directory or permission issue because if I use hardcoded value, the code works fine.
    The error message is invalid File directory.
    Here is the related part of the code.
    -- open file handler
    IF UTL_FILE.IS_OPEN(l_FileHandler) THEN
    UTL_FILE.FCLOSE(l_FileHandler);
    ELSE
    l_FileHandler := UTL_FILE.FOPEN ( location => l_FileDir,
    filename => l_FileName,
    open_mode => 'W',
    max_linesize => 32767 );
    END IF;Ok, based on your input so far, I have cooked up a simple testcase.
    Make sure you are doing something similar to this -
    test@XE>
    test@XE> -- show the contents of the anonymous PL/SQL script
    test@XE> -- You are probably passing two parameters - the file location and the file name
    test@XE> --
    test@XE> ! cat test5.sql
    DECLARE
      l_FileHandler UTL_FILE.FILE_TYPE;
      l_FileDir     VARCHAR2(200) := '&1' ; 
      l_FileName    VARCHAR2(200) := '&2' ; 
    BEGIN
      -- open file handler
      IF UTL_FILE.IS_OPEN(l_FileHandler) THEN
        UTL_FILE.FCLOSE(l_FileHandler);
      ELSE
        l_FileHandler := UTL_FILE.FOPEN ( location => l_FileDir,
                                          filename => l_FileName,
                                          open_mode => 'W',
                                          max_linesize => 32767 );
        UTL_FILE.PUT_LINE(file => l_FileHandler, buffer => 'Hello, World!');
        UTL_FILE.FCLOSE(file => l_FileHandler);
      END IF;
    END;
    test@XE>
    test@XE> -- execute it
    test@XE> @test5.sql '/usr/tmp' 'first.txt'
    old   3:   l_FileDir     VARCHAR2(200) := '&1' ;
    new   3:   l_FileDir     VARCHAR2(200) := '/usr/tmp' ;
    old   4:   l_FileName    VARCHAR2(200) := '&2' ;
    new   4:   l_FileName    VARCHAR2(200) := 'first.txt' ;
    DECLARE
    ERROR at line 1:
    ORA-29280: invalid directory path
    ORA-06512: at "SYS.UTL_FILE", line 33
    ORA-06512: at "SYS.UTL_FILE", line 436
    ORA-06512: at line 10
    test@XE>
    test@XE> -- Create a directory object that points to "/usr/tmp"
    test@XE> create directory log_dir as '/usr/tmp';
    Directory created.
    test@XE>
    test@XE> -- now invoke the script
    test@XE> -- Note - I pass the value "LOG_DIR" in uppercase. That's the name of my directory object.
    test@XE> --
    test@XE> @test5.sql 'LOG_DIR' 'first.txt'
    old   3:   l_FileDir     VARCHAR2(200) := '&1' ;
    new   3:   l_FileDir     VARCHAR2(200) := 'LOG_DIR' ;
    old   4:   l_FileName    VARCHAR2(200) := '&2' ;
    new   4:   l_FileName    VARCHAR2(200) := 'first.txt' ;
    PL/SQL procedure successfully completed.
    test@XE>
    test@XE> -- Since my Oracle client is on the same machine as the Oracle server, I can check
    test@XE> -- this file "/usr/tmp/first.txt" quite easily
    test@XE>
    test@XE> ! cat /usr/tmp/first.txt
    Hello, World!
    test@XE>
    test@XE> isotope

  • Passing a QueryString in Struts-Config.xml

    Hi,
    How to pass a queryString in Struts-Config.xml??
    For eg,
    <forward name="Success"                    path="/TestAction.do?method=nextPage&Id=100">
                   </forward>
    Not working in struts 1.1. Where it is taking only one parameter where it is not taking the "&" part?? What is the problem here. Please do provide
    a solution for this.
    Thanks,
    JavaCrazyLover

    Hi
    If you want to pass two or more parameters in struts-config.xml do it like this
    eg : <forward name="Success" path="/TestAction.do?method=nextPage&Id=100">
    </forward>
    It worked for me. instead of & use &

  • Passing dynamic parameters to an IR Report

    Hello,
    We have installed Hyperion BI+ 9.3.1. We are in the process of evaluating the development of IR reports which would
    have a requirement to have parameters passed dynamically. For example, we'd be interested in passing a date as a parameter which then would be used by the query inside IR to filter/bring back data from the database pertinent to the date being passed.
    The need for this is because once developed we want to execute the IR on a weekly basis whereby the date keeps moving forward to be then used to extract relevent data.
    Any thoughts on how this can be done? Also, on a related note are there any backend command line utilities or interfaces that can be used to pass the parameter dynamically to the IR report?
    Thanks in advance
    Rajesh

    Doug,
    Thanks for the response. The delivery of the report output would be via Workspace (iHTML). I mentioned date parameter as an example. The report or reports may need to accept other paramaters as well - like department id or product. While the number of parameters and the nature of the parameters would be known ahead of time the value would need to be derived dynamically (by say reading a database table containing transactional data)
    As for the command line utility, I am thinking more along the lines of say Oracle Reports which enables you to invoke a run-time command (rwcli60 for example) and pass the necessary arguments to the report.
    I have seen the sample java programs that are shipped with the product (and we have used one of them called AddBqy) but haven't seen one that enables passing dynamic parameters.
    I will look into the SmartCut option as recommended by you.
    Any more insights/suggestions will be greatly appreciated.
    Thanks
    Rajesh

  • How can we use C# to read dynamic parameter's value list from .rpt?

    I'm using Cystal Report 2008. We know starting from CR XI we can create dynamic parameters, the list of items of this kind of parameter are fetching from database. So in general the SQLs to get the list of values for dynamic parameters are stored in the .rpt.
    In Crystal Report Designer, if I preview a report with dynamic parameters, it will first query the database and then show the input dialog with list of values from database for user to choose. My question is can we implement the same thing by our C# code? I'm planning to use C# code to read this dynamic parameter's value list from .rpt and render them on the web page. Then pass back the user selected values to the .rpt to run the report after user make the choice. I didn't find any APIs can do this. Is it possible?
    Thanks in advance!!

    Hi,
    Can you explain a bit in detail, I have similar scenario. I am using the following code but not getting the Column name for dynamic parameter list.
    foreach (ParameterFieldDefinition prm
                              in reportDocument.DataDefinition.ParameterFields)
                    try
                        string vParameterFieldName;                   
                        *vParameterFieldName = prm.ParameterFieldName.ToString();*
    Shakeel

  • Issue passing dynamic paramters using GO URL in OBIEE 11g

    Hi All,
    I am trying to implement a GO URL and pass 6 dynamic paramters to the target dashboard page.
    The issue is that, When I navigate from the column which is having GO URL, It is just passing the first parameter among the 6 parameters.
    URL:
    '<a href=http://servername/analytics/
    saw.dll?GO&path=/shared/xxx/aa%20bb/report%20one
    &Action=Navigate&P0=6&P1=eq&P2="Fact%20-%20xxx".ID1&P3='||CAST("Dim - Abc"."One ID" AS CHAR)||'&P4=eq&P5="Fact%20-%20xxx".ID2&P6='||CAST("Dim - Abc"."Two ID" AS CHAR)||'&P7=lt&P8="Fact%20-%20xxx".DATE&P9='||CAST(TIMESTAMPADD(SQL_TSI_DAY,1,"Time"."Day") AS CHAR)||'&P10=eq&P11="Fact%20-%20xxx"."Three%20ID"&P12='||CAST("Dim - Abc"."Three ID" AS CHAR)||'&P13=ge&P14="Fact%20-%20xxx".DATE1&P15='||CAST(TIMESTAMPADD(SQL_TSI_DAY,1,"Time"."Day") AS CHAR)||'&P16=eq&P17="Time".Day&P18='||CAST("Time"."Day" AS CHAR)||'style="text-decoration:none;">'||"Dim - Abc.Name"||'<--/a>'
    When I try with actual values for all the 6 parameters, The parameters are being passed perfectly.
    Also I have tried passing each parameter individually in the same syntax as in the above URL and it is working fine.
    Also I have tried the new syntax of GO URL i.e.,
    '<a href=http://servername/analytics/
    saw.dll?GO&path=/shared/xxx/aa%20bb/report%20one
    &Action=Navigate&col1="Fact%20-%20xxx".ID1&val1='||CAST("Dim - Abc"."One ID" AS CHAR)||'&op1=eq&col2="Fact%20-%20xxx".ID2&val2='||CAST("Dim - Abc"."Two ID" AS CHAR)||'&op2=eq&col3="Fact%20-%20xxx".DATE&val3='||CAST(TIMESTAMPADD(SQL_TSI_DAY,1,"Time"."Day") AS CHAR)||'&op3=lt&col4="Fact%20-%20xxx"."Three%20ID"&val4='||CAST("Dim - Abc"."Three ID" AS CHAR)||'&op4=eq&col5="Fact%20-%20xxx".DATE1&val5='||CAST(TIMESTAMPADD(SQL_TSI_DAY,1,"Time"."Day") AS CHAR)||'&op5=ge&col6="Time".Day&val6='||CAST("Time"."Day" AS CHAR)||&op6=eq'style="text-decoration:none;">'||"Dim - Abc.Name"||'<--/a>'
    Even with this syntax, The issue is same that I am only able to pass the first filter.
    Anyone please help.
    Thanks in Advance.

    To avoid encoding problems use POST method. Here is js example for OBIEE 10g, but I bellieve you will find similar XML syntax in 11g.
    function getGoXML(P){
         var goXML = '<sawx:expr xmlns:sawx="com.siebel.analytics.web/expression/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="sawx:logical" op="and">';
         for (var i=0; i<P.length-1; i=i+2){
              goXML = goXML + '<sawx:expr xsi:type="sawx:comparison" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" op="equal">';          
              goXML = goXML + '<sawx:expr xsi:type="sawx:sqlExpression">' + P[i] + '</sawx:expr>';
              goXML = goXML + '<sawx:expr xsi:type="sawx:untypedLiteral">' + P[i+1] + '</sawx:expr>';
              goXML = goXML + '</sawx:expr>';          
         goXML = goXML + '</sawx:expr>';
         return goXML;
    function dashboardPageNav (navParams){     
         var tForm = saw.createForm("customNavForm");
         tForm.action = saw.commandToURL("Dashboard");
         saw.addHiddenInput(tForm, "PortalPath", navParams.portalPath);
         saw.addHiddenInput(tForm, "Page", navParams.portalPage);
         saw.addHiddenInput(tForm, "Action", "Navigate");
         saw.addHiddenInput(tForm, "StateAction", "NewPage");
         saw.addHiddenInput(tForm, "P1", "dashboard");
         saw.addHiddenInput(tForm, "P0", getGoXML(navParams.P));
         tForm.submit();
    dashboardPageNav({
         portalPath: '<portal path>',
         portalPage: '<page name>',
         P: new Array(                         
              '<param1 name>', '<param1 value>',
              '<param2 name>', '<param2 value>',
              '<param3 name>', '<param3 value>',
              '<param4 name>', '<param4 value>'
    });

Maybe you are looking for

  • File Save As Other Reader Extended PDF Enable Commenting & Measuring GRAYED OUT

    I have an PDF form created in Adobe LiveCycle Designer ES 10.0. When I open in Reader, All the "Sign" options are grayed out. Under "Properties" Signing is allowed but Commenting is not. From all I have seen, I hope that allowing Commenting will allo

  • Is the phone replaceable? (Broken lock button, no warranty)

    Hi, I bought an iPhone 4S off a friend about 4 months ago, (the phone already had a jammed lock button) and it has been great until yesterday when it suddenly turned off itself. ( I can't turn it on manually because the button is not working)  so I p

  • Surprising Behavior with ChainedExtractor (Improved Example)

    If I create the following filter: InFilter(KeyExtractor("getPurpose"), someSet) I get the expected behavior. If I wrap the KeyExtractor in a ChainedExtractor... InFilter(ChainedExtractor([KeyExtractor("getPurpose")], someSet) I get the exception "MIs

  • Suspicious contact request

    I got a contact request from someone who claims to be a skype lottery agent named "skype.userlottery2012(JAMES HEROLD)" saying that I have emerged as one of your lucky winners for the year 2011 skype user's lottery. Is this a scam or do I need to add

  • What is possible with non oracle components in the EMGC 10g release 3

    Hello, What is possible with non oracle components in the EMGC 10g release 3 Our customer wants to also monitor and maintain non oracle components with EMGC 10g release 3. Some non oracle components are: Routers, Firewalls, Application Servers, Switc