How to display current session parameter value

Hi,
How can a db user know value of a session parameter, if he doen't have privilege to access v$parameter?
SQL> conn hr/hr
Connected.
SQL> show parameter QUERY_REWRITE_ENABLED
ORA-00942: table or view does not exist
SQL> alter session set QUERY_REWRITE_ENABLED=true ;
Session altered.
-- how can the user HR know the value of QUERY_REWRITE_ENABLED

You can code a PL/SQL function and grant only execute privilege to the user:
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE    11.1.0.6.0      Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
SQL> drop user admin cascade;
User dropped.
SQL> create user admin identified by admin;
User created.
SQL> grant create session, create procedure to admin;
Grant succeeded.
SQL> grant select on sys.v_$parameter to admin;
Grant succeeded.
SQL> connect admin/admin
Connected.
SQL> show user;
USER is "ADMIN"
SQL> create or replace function get_parm (p_pn in varchar2) return varchar2
  2  as
  3  l_val v$parameter.value%type;
  4  begin
  5   if ( UPPER(p_pn) = 'QUERY_REWRITE_ENABLED' )
  6   then
  7        execute immediate 'select value from v$parameter where name = :1 '
  8        into l_val using p_pn;
  9        return l_val;
10   else
11      raise_application_error(-20000,'Invalid parameter');
12      return null;
13   end if;
14  end;
15  /
Function created.
SQL> grant execute on get_parm to test;
Grant succeeded.
SQL> connect test/test
Connected.
SQL> show parameter query
ORA-00942: table or view does not exist
SQL> select admin.get_parm('query_rewrite_enabled') from dual;
ADMIN.GET_PARM('QUERY_REWRITE_ENABLED')
TRUE
SQL> select admin.get_parm('compatible') from dual;
select admin.get_parm('compatible') from dual
ERROR at line 1:
ORA-20000: Invalid parameter
ORA-06512: at "ADMIN.GET_PARM", line 11

Similar Messages

  • How to display current date in query header?

    Hi,
    How to display current date in query header?
    I use Query Designer for development.
    Thanks,
    Arun KK

    Hi Arun,
    You can define fixed header lines and footer lines so that when you generate the query list, they can receive current values of certain fields. When you define a header line or a footer line, you must specify a character string of the type &field, where field is the short name of a field.
    This function allows you (for example) to place a sort criterion in the header line.
    You can include the following fields as variables in the headers directly:
    %NAME
    Name of the user processing the query
    %DATE
    Current date
    %TIME
    Current time
    %PAGE
    Current page number (6 characters)
    %P
    Current page number (3 characters)
    These fields can be used in the short forms N,D,T and P. If you want to use these letters as short names for query fields, the field values from the query are used.
    You can also see the link
    [http://help.sap.com/saphelp_nw70/helpdata/EN/6e/dd68721faf11d6b1d500508b6b8b11/frameset.htm]
    Regards,
    NR

  • How to display Current Year and Month in Drop Down list

    Hi Dear friends,
    I am devloping a report. It has got 2 pages--input and output(Report) page.
    IN input page, user will select Month and Year from drop down list as one of the input parameters. (seperate drop down list 4 month and year)
    Now, my problem is:
    HOw to display current month and year by default in the dropdown list...........
    I hope my question is clear.
    Please help.
    Regards,
    ASh

    NO da,
    it is not working.
    First i tired with for-loop. I initialized variable "i" to -2 (i=-2) I would get the year drop down list from 2003 but, by default 2003 would come.
    So, i posted the question.
    I tried your code. It is giving following error.
    A Servlet Exception Has Occurred
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occured between lines: 122 and 127 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:182: Invalid type expression.
    first.set(Calendar.YEAR, 2003)
    ^
    An error occured between lines: 127 and 131 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:186: Invalid declaration.
    out.write("\r\n \r\nYear : \r\n \r\n"); ^ An error occured between lines: 198 and 203 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:282: Invalid type expression. first1.set(Calendar.YEAR, 2003) ^ An error occured between lines: 203 and 207 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:286: Invalid declaration. out.write("\r\n \r\nYear :\r\n \r\n");
    ^
    4 errors
    Pls. Help.
    Regards,
    Ashu

  • How to display my input history values on Filename filed (selection screen)

    Hi All,
    Please let me know how to display my input history values under the field of selection screen.
    I created Zprogram as below.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
      PARAMETERS: P_FILE  TYPE RLGRAP-FILENAME OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    I displayed a selection screen of my Zprogram, my cursor put on P_FILE field, and enter BACKSPACE key,
    so it doesn't display my input history values.
    Of course I've selected Local Data History 'ON' of my GUI option,
    so it's displayed my input history values on any other fields.
    If you know why, please let me know.
    Regards,
    Rie.

    In the GUI options, there is also a setting for the maximum length of fields for storing the history, maybe it is set to small, as your selection field is length 128.
    Alternatively you can switch to a STRING, I have observed that the history is displayed after the first letter is being entered (maybe dependent on GUI version, who knows...)
    Thomas

  • How to display struts form list values?

    HI,
    How to display struts form list values?
    I am having master and child data.
    I can set list values master and child in action class.
    How to display the master and child data in struts jsp form.
    <logic:iterate id="result" name="listofEmployees" >
    <td ><bean:write name="result" property="id"/></td>
    <td ><bean:write name="result" property="name"/></td>
    <td > <bean:write name="result" property="list"/>  </td>
    </tr>
    </logic:iterate>Here I am displaying master data succesfully.
    How to iterate values of <td ><bean:write name="result" property="list"/></td>in action class i added bean class to this list.
    how to iterate this list with java bean and display my child data
    Thanks
    sai

    Struts 1 or 2?
    I guess 2 'cause you're just talking about Action, without mentioning the Form.
    In STRUTS 1 it goes like this: forward to the page and use logic:iterate tag. Don't know about STRUTS 2, but It shouldn't be too different.
    bye.

  • How to understand the strange parameter values shown by 'pstack core'

    I encounterred a problem that led to a core dump. I use 'pstack core' to shown the calling stack.
    However I could hardly understand some of the parameter values below:
    core 'core.150108' of 5016:     cmcfun
    ff1e1370 __1cLComEndPointFsendv6MpnFiovec_i_i_ (c, ffbfedf8, 2, 2, c, 0) + 4
    Why did the 'this' pointer of the instance of class ComEndPoint become 0xc? I don't think it is a valid value of pointer. Does anybody have any idea about this problem?
    ff1e5b00 __1cYComTransaction_Icallback6FpnPpdo_transaction_pcii_v_ (6ab90, 0, 0, 0, ffbff1b8, 0) + dc
    According to the source code, the 3rd parameter in the function below, which value is 0x66, was not changed in the scope of the function. However it became 0x0 when it was used as the 4th parameter to call the function above. What't the matter?
    ff1528e8 pdo_dispatch (6ab90, ad, 66, 0, 0, 0) + dc
    I heard that Sun C++ uses 'register windows' to pass the parameters, i0~i5 are used for the first 6 ones. Somebody told me that what I saw in the pstack might not be creditable because the registers might be changed within the function. Is that so? Would anybody plz tell me more details?
    Thanks in advance.
    Edited by: DirtyBear on Feb 15, 2008 1:17 AM

    Register windows are a property of the SPARC computer architecture, not a property of a compiler. SPARC has multiple sets of registers. The function call instruction advances the "register window" to reveal the next set of registers, if there is one. If not, the registers are spilled to the stack to free up a window. The function return instruction moves the window back. (It's a purely hardware feature.) Eight of the registers in adjacent windows overlap, the origin of the "window" term. Registers %o0 thorugh %o7 in the caller become registers %i0 through %i7 in the called function.
    On SPARC and x64, some function arguments are passed in registers, depending on how many arguments there are and their types. (The x86 architecture has no registers available for passing arguments.) On entry to a function, the parameters passed in registers might be saved on the stack, but do not necessarily need to be saved on SPARC. The Solaris ABI requires that space for the registers be allocated, but the space is not necessarily used.
    In a core dump, the actual registers, particularly for functions other than the current one, are not available. The pstack operation doesn't know how many parameters a function has or what type they are. It shows the contents of the first 6 words on the stack that would hold arguments, if there were arguments, and if they were actually saved on the stack.
    In optimized code on any platform, the stack area for a variable or argument is not kept up to date. Computations are kept in registers to the extent possible, and saved in memory only when necessary.
    On SPARC in particular, the argument values shown in a stack trace need not be accurate.

  • How to get the session variable value in JSF

    Hi
    This is Subbus, I'm new for JSF framewrok, i was set the session scope for my LoginBean in faces-config.xml file..
    <managed-bean-name>login</managed-bean-name>
    <managed-bean-class>LoginBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope> like that...
    So all parameter in LoginBean are set in session right ?... for example i used userId is the Parameter...
    Now i need to get the the userId parameter from that session in my another JSP page.. how i get that ?..
    Already i tried
    session.getAtrribute("userId");
    session.getValue("userId");
    but it retrieve only "null" value.. could u please help me.. it's very urgent one..
    By
    Subbus

    Where i use that..is it in jsp or backend bean...
    simply i use the following code in one backend bean and try to get the value from there bean in the front of jsp page...
    in LogoutBean inside
    public String getUserID()
         Object sessionAttribute = null;
         FacesContext facescontext=FacesContext.getCurrentInstance();
         ExternalContext externalcontext=facescontext.getExternalContext();
         Map sessionMap=externalcontext.getSessionMap();
         if(sessionMap != null)
         sessionAttribute = sessionMap.get("userId");
         System.out.println("Session value is...."+(String)sessionAttribute);
         return (String)sessionAttribute;
         return "fail";
    JSP Page
    <jsp:useBean id="logs" scope="session" class="logs.LogoutBean" />
    System.out.println("SS value is ...."+logs.getUserID());
    but again it retrieve only null value.. could u please tell me first how to set the session variable in JSF.. i did faces-config only.. is it correct or not..
    By
    Subbus

  • Iowagie - How do I pass in parameter values to an event handler -onEndPage?

    Hi,
    I have spent a while on this and is getting quite frustrating, so any help much appreciated.
    I am trying to create a footer on each of my PDF pages that will contain an image and a table. I have successfully created a separate class to my servlet, EndPage.java that contains an onEndPage() method. The problem is, I need to pass in three parameter values into this method, storeNo, langId and transNo.
    How do I go about doing this?
    PDFPrint.java
    public class PDFPrint extends HttpServlet {
        private ByteArrayOutputStream getDoc(ByteArrayOutputStream baos, HttpServletRequest requ, String transNo, String storeNo, String langId)     {
            HttpSession session = requ.getSession();
            Document document = new Document();                    
            PdfWriter writer = PdfWriter.getInstance(document, baos);
            writer.setPageEvent(new EndPage());     
            document.open();
    }EndPage.java
    public class EndPage extends PdfPageEventHelper {
        public void onEndPage(PdfWriter writer, Document document) {
            try {
                Rectangle page = document.getPageSize();
                PdfPTable head = new PdfPTable(3);
                PdfPCell cell1 = new PdfPCell(new Phrase("Pueblo Nativo S.A. de C.V", FontFactory.getFont(FontFactory.HELVETICA, 17f)));
                cell1.setHorizontalAlignment(Element.ALIGN_LEFT);
                cell1.setBorder(0);
                for (int k = 1; k <= 1; ++k)
                     head.addCell(cell1);
                head.setTotalWidth(page.width() - document.leftMargin() - document.rightMargin());
                head.writeSelectedRows(0, -1, document.leftMargin(), page.height() - document.topMargin() + head.getTotalHeight(),
                          writer.getDirectContent());
                PdfPTable foot = new PdfPTable(1);
                PdfPCell cell = new PdfPCell(new Phrase("Disclaimer to go here.", FontFactory.getFont(FontFactory.HELVETICA, 17f)));          
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setBorder(0);
                for (int k = 1; k <= 1; ++k)
                     foot.addCell(cell);
                foot.setTotalWidth(page.width() - document.leftMargin() - document.rightMargin());
                foot.writeSelectedRows(0, -1, document.leftMargin(), document.bottomMargin(),
                writer.getDirectContent());
            catch (Exception e) {
                throw new ExceptionConverter(e);
         public static void main(String[] args) {
    }Thanks!

    Try adding that information data as properties to the HTTP session.
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    HttpSession session = (HttpSession)externalContext.getSession(false);
    session.setAttribute("stornNo", storeNo);
    session.setAttribute("langId", langId);
    session.setAttribure("transNo", transNo);In PDFPrint, you can get those properties using session's getAttribute method, and pass them to the constructor or as parameters to onEndPage.

  • How to get the URL parameter value when navigating from JSP Page to portal

    Hi All,
    I have web Dynpro application with one button, while clicking that button It will navigate to JSP page as external window. In the JSP page I have a input field and Button.
    In the JSP page input field I will enter some values and press submit button, it will navigate to Portal page by passing some URL parameter with values.
    Once user entering to portal by default WD page displayed, the same WD page I try to get the URL Parameter which I have passed from JSP page, but I am not able to get the URL parameter value.
    If same application running in without portal, I can able to get the URL parameter values. I am getting the URL parameter by interface view default inbound plug parameter.
    How do we resolve this problem?
    Regards,
    Boopathi M

    Hi
    Please try  these link might helpful for you
    1.[How to call WebDynPro application from JSP |/thread/452762 [original link is broken];
    2.[How to get the previous page url from abstract portal component? |/thread/1289256 [original link is broken];
    3.[how to launch and pass a parameter |/thread/5537 [original link is broken];
    Best Regards
    Satish Kumar

  • How to over ride a parameter value in the URL

    Hi
    I am calling a 10g report through a form as ...
    web.show_document('/reports/rwservlet?MYKEYINCGICMDFILE'&report=stock_status','_blank');
    MYKEYINCGICMDFILE is a key in cgicmd file where I have passed values like userid,destype, desname etc.
    Now I want to change the destype for a specific report and I want to pass the parameter through URL, how can I override the destype value provided in the key and pass through URL?
    I tried as ...
    web.show_document('/reports/rwservlet?MYKEYINCGICMDFILE'||'&desformat=spreadsheet&destype=file&desname=c:\stock_check.xls&report=stock_status','_blank');
    but still getting the value from the key.
    Thanks

    Leave out MYKEYINCGICMDFILE on the URL and specify all the parameters. That of course exposes un/pw.
    Or create a second key.
    Better still: use run_report_object in Forms instead of calling a report via web.show_document. This takes un/pw from the currently logged in user.

  • Crystal Report Viewer 11.5 Java SDK - How to set sub report parameter value

    Good day!
    I have a report with 3 sub-reports in the detail section. Main report has two parameters and each sub-report has one parameter in turn. We have our own JSP to receive parameter values from the user. I am using the following code to do the parameter value setting later into the report. Parameter value setting works for main report, but not for the sub-report.
    I get an Error, for the first sub-report, from the viewer saying:
    The parameter 'parametername' does not allow null values
    On this article: [article link|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap%28bd1lbizjptawmq==%29/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313337333233323331%7D.do]
    It says to set the report name of the parameter field to the name of the sub report. On this aspect, assuming this tip/solution works, I would like to read the names of the sub-reports and their parameter names. I do not want to hard-code them into our application.
    Here is my current code:
    sdk.occa.report.data.Fields parameterFields = new Fields();
    I have a HashMap of <parameterName, parameterValue>
    Iterate through the map
    report.data.ParameterField aParameterField = new ParameterField();
    aParameterField.setReportName(""); //main report
    report.data.Values theValues = new Values();
    ParameterFieldDiscreteValue aParameterFieldDiscreteValue = new ParameterFieldDiscreteValue();
    aParameterFieldDiscreteValue.setValue (aValue);
    theValues.add(aParameterFieldDiscreteValue);
    aParameterField.setName(parameterName)
    aParameterField.setCurrentValues(theValues);
    parameterFields.add(aParameterField);
    viewer.setParameterFields(parameterFields);
    Please look at the line:
    aParameterField.setReportName(""); //main report
    Here's where I would like to say
    if (parameter is subreport's parameter) then setReportName(subreport name);
    Thx

    It was little difficult to navigate down the objects to find the sub reports and their parameters. I am attaching the code:
    May be there are other ways to do the same.
    public String getReportNameForParameter (String parameterName, ReportClientDocument reportClientDoc)
            String result = "";
            boolean found = false;
            try {
                SubreportController src = reportClientDoc.getSubreportController();
                DataDefController ddc = reportClientDoc.getDataDefController();
                IDataDefinition idd = ddc.getDataDefinition();
                Fields fs = idd.getParameterFields();
                Iterator fiter = fs.iterator();
                while (fiter.hasNext()) {
                    IField ifld = (IField) fiter.next();
                    if (parameterName.equals(ifld.getName())) {
                        found = true;
                    //System.out.println ("\t Field Name/Description/HeadingText: " + ifld.getName() + "/" + ifld.getDescription() + "/" + ifld.getHeadingText());
                if (!found) {
                    IStrings reportNames = src.getSubreportNames();
                    //System.out.println ("  Sub Reports If Any ...");
                    if (reportNames != null) {
                        Iterator iter = reportNames.iterator();
                        while (iter.hasNext()) {
                            String repName = (String) iter.next();
                            //System.out.println ("\t Sub Report Name " + repName);
                            ISubreportClientDocument srcd = src.getSubreport(repName);
                            ddc = srcd.getDataDefController();
                            idd = ddc.getDataDefinition();
                            fs = idd.getParameterFields();
                            fiter = fs.iterator();
                            while (fiter.hasNext()) {
                                IField ifld = (IField) fiter.next();
                                if (parameterName.equals(ifld.getName())) {
                                    result = repName;
                                    break;
                                //System.out.println ("\t\t Field Name/Description/HeadingText: " + ifld.getName() + "/" + ifld.getDescription() + "/" + ifld.getHeadingText());
            //System.out.println ("********************************************************** ");
            catch (Exception exc) {
                System.out.println ("Error/Exception while trying to find the report name for parameter [" + parameterName + "]");
                System.out.println ("*******************************************************************************************");
                exc.printStackTrace();
            return result;

  • How to include input user parameter values in XML report output?

    How can i include input user parameter values in XML report output. I a have a report which can be run by providing start date and end date. I would like to include value of these parameters in XML output to enable me to figure out dates for report, just by looking at XML output.
    Rgds,
    manish

    I think all the XML attributes can contain lexicals. If you bring up the property palette against the report object you can just set the following:
    XML Tag Attributes: myParameter="&<P_1>"
    where P_1 is your user parameter.

  • How to display current navigation on "Body only" page layout

    I create a new page and applied "Body only" page layout which is basically PageFromDocLayout.aspx
    But it doesn't show current navigation. How do I show current navigation on left side of the page? I have the code which will display current navigation but I don't know where to paste it inside page layout because there doesn't seem to be any space for that.
    Or is it something that I can enable disable from somewhere?

    There is no QuickLaunch snippet. There is one by the name of "Vertical Navigation" which I think is QuickLaunch snippet so I copied its code in PlaceHolderMain section inside page layout but getting error:
    ContentPlaceHolder can only be used in .master files.
    EDIT
    Ok I managed to do it by adding Vertical Navigation inside a separate <td> in my master page and then I only display it when page is not home page. So the is something like:
    HTML CODE IN MASTER PAGE
    <td id = "leftmenu" style="display:none">Vertical Navigation code here</td>
    <td>ContentPlaceHolderMain here</td>
    JAVASCRIPT CODE
    if(page is not home page then)
              document.getElementById("leftmenu").style.display = "block";

  • How to identify current session id (SID)?

    How can a user identify their current session id if auditing is not enabled and account has connect role only? select * from v$mystat where rownum = 1; Fails (ora-942).

    I think this is going to be difficult. I've included a completely convoluted idea I thought of using just CONNECT accessible objects (looking on a 9.2 database). You can't make this a stored procedure though (no direct privileges). I'll be interested to see if someone can come up with something easier.
    declare
      rindex binary_integer := dbms_application_info.set_session_longops_nohint;
      slno binary_integer;
      usid varchar2(24) := dbms_session.unique_session_id;
      mysid number;
    begin
      dbms_application_info.set_session_longops(rindex, slno, 'get_sid:' || usid);
      select sid
      into mysid
      from v$session_longops
      where opname = 'get_sid:' || usid
        and rownum = 1;
      dbms_output.put_line(mysid);
    end;Richard

  • How to use different default parameter value for different report subscriptions

    In ssrs is it possible to define different default parameter values for different subscriptions? In the following example I have a report which has two subscriptions with different start date and end date values:
    Report name – Testsubscription.rdl
    Subscription-1
    Input parameter (default values):
    start_date = first day of current Month
    end_date = till date
    Subscription-2
    Input parameter (default values):
    start_date = first day of current Quarter
    end_date = till date
    I know an alternative way of doing this would be to copy the rdl file with a different name but I am curious whether this can be done within a single report definition file. I am using SQL Server 2008 R2 Standard Edition.
    Thanks!
    spp

    Hi sppdba,
    As per my understanding, there is a report with two parameter: start_date and end_date, you want to configure subscription for the report, and set different default values for start date and end date. And you want to know if it is possible to achieve you
    goal by using a single report definition file.
    Since you are using SQL Server 2008 R2 Standard Edition, we need to achieve your goal by configuring two subscriptions for the report. For detail information, please refer to the following steps:
      1. In design surface, right click start_date and open Parameter Properties dialog box.
      2. In General pane, type Name and Prompt, set Data Type to Date/Time.
      3. Click Available Values in left pane, select Specify Values.
      4. Click Add button, in Label text box, type “First day of Current Month”, click (fx) button in Value section, then type the expression like below:
    =DateSerial(Year(Now()), Month(Now()), 1)
      5. Click Add button, in Label text box, type “First day of Current Quarter”, click (fx) button in Value section, then type the expression like below, then click OK.
    =DateSerial(Year(Now()), (3*DatePart("q",Now()))-2, 1)
      6. Right click end_date and open Parameter Properties dialog box.
      7. In Available Values pane, select Specify Values.
      8. Click Add button, in Label text box, type “Today”, click (fx) button in Value section, then type the expression =Today(), then click OK.
    Now that the parameters are created, we need to configure subscription for the report. For detail information, please follow these steps:
      1. Open Report Manager, and locate the report for which you want to create a new subscription.
      2. Hover over the report, and click the drop-down arrow.
      3. In the drop-down menu, click Manage. This opens the General properties page for the report.
      4. Select the Subscriptions tab, and then click New Subscription.
      5. Select the delivery extension and data source for the subscription.
      6. Select a method of delivery, then choose report delivery options.
      7. Specify conditions that cause the subscription to process and delivery to occur.
      8. Set start_date to First day of Current Month, end_date to Today, then click OK.
      9. Create a new subscription as step4 to 7, set start_date to First day of Current Quarter, end_date to Today, then click OK.
    The following screenshots are for your reference:
    For detail information about Creating Standard Subscriptions, please refer to the following document:
    http://msdn.microsoft.com/en-us/data/ms156307(v=sql.105)
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.

Maybe you are looking for