How to set a bind variable across the pages in a report

I want to create a portal report where data will come from a table for a date range for a week.
For e.g select event_date,last_name, event_name
from RESOURCES
where event_date between trunc(to_date(:curr_date,'DD-MON-RRRR'))
and trunc(to_date(:curr_date,'DD-MON-RRRR')+ 7)
The :curr_date is defined as a bind variable whose default value is sysdate.
Now, when we run the report for the first time, it takes the :curr_date as
sysdate and prints the report.
I have two buttons in the report output like "previous week" and "next week".
If someone presses previous week, the same report should run with curr_date
as sysdate-7 and if someone presses next week, the report should run with
curr_date as sysdate +7 and also the :curr_date sets to sysdate - 7 or sysdate + 7
depending on the button pressed.
Problem:
How do I set the value of curr_date if someone presses any of
previous week/next week.
null

Best to state your JDev version, and technology stack (eg. ADF BC) when posting.
I can think of 2 approaches.
1) Create a parent VO based on SELECT :bindVar FROM dual, then create links between your other VOs and the parent
2) Create a AM client interface method that programatically sets the bind variable in each VO.
Can you specify your use case? This one tends to come up when discussing effective from/to dated queries.
CM.

Similar Messages

  • How to set a bind variable into a vo query from the current vo ?

    I would like to exclude from my list of values defined in a view object the already referenced items in the current view object content.
    Let's say i have dept and emp with a many to many relationships, I would like that the already existing dept for emp not listed (excluded) in the list of values for emp.
    Do i need to define a bind parameters and set it during search or is it possible to use an expression that will refer the current row attribute representing the dept ?
    I didn't find an example or explanation how to set bind parameters defined in a view object query from seach pages or list of values ui components. May be somebody know how to find the info.
    Thank you

    I think that bind variable accessors in the VO class is what you need. You can override the getter method of the bind variable "LocaleCode2" in order to return the first 2 chars from the bind variable "LocaleCode". Have a look at this blog post for details:
    http://jdeveloperandadf.blogspot.com/2011/03/custom-java-bind-variable-in-where.html
    Dimitar

  • How to share a bind variable across multiple view objects?

    Hi, Can someone tell me if it's possible to share a bind variable among multiple view objects within an application module? My web page displays data from different VOs on different regions. But all data should be controlled by the same bind variable, which appears in all queries. How can I achieve this?
    Please help.

    Best to state your JDev version, and technology stack (eg. ADF BC) when posting.
    I can think of 2 approaches.
    1) Create a parent VO based on SELECT :bindVar FROM dual, then create links between your other VOs and the parent
    2) Create a AM client interface method that programatically sets the bind variable in each VO.
    Can you specify your use case? This one tends to come up when discussing effective from/to dated queries.
    CM.

  • How to set default bind variable value to task parameter value

    Hi,
    I 'm implementing a BPEL process with a human task, and I autogenerate the task form. I have a custom sql table that stores opinions, different processes should show different opinios, so my ADF table can only show records related to that process. A custom process number is sent to the task form as a task parameter. How do I use that value as the bind variable default and only value?
    Thanks,
    I.D.

    Hi Shay and thanks for your reply,
    What I want is what you have but without the login page. I tried to start my flow with an action and for some reason it didn't work.
    Is there anything else you can tell me?
    Thanks,
    I.D.
    P.S. I was able to get it to work using the aproach Frank Nimphius described in another post.
    Re: How do I prepopulate a bind variable from a session variable?
    Anyway just out of curiosity could you please tell me if I could have done it your way?
    Thanks a lot,
    I.D.
    Edited by: user8696770 on 5/Ago/2009 7:12

  • How do I use bind variables for the SQL statements having IN clause

    SELECT id, name FROM t
    WHERE id in (10,20,30)
    As the IN list will have 'n' number of values, I am not able to specify fixed number of bind
    variables like
    SELECT id, name FROM t
    WHERE id in (?,?,?....)

    452051 wrote:
    I am not able to specify fixed number of bind variablesYou could use collection:
    SQL> create or replace force
      2    type NumList
      3      as
      4        table of number
      5  /
    SQL> select ename from emp where deptno member of NumList(10)
      2  /
    ENAME
    CLARK
    KING
    MILLER
    SQL> select ename from emp where deptno member of NumList(10,20,30)
      2  /
    ENAME
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    ENAME
    JAMES
    FORD
    MILLER
    14 rows selected.
    SQL> This way you have one bind variable - collection.
    SY.

  • How to set a value wo resending the page?

    hello,
    I have a simple question.
    Here is the scenario i need to implement:
    Two items on the page:
    1. "select list" returns list of values ( distinct )
    2. "popup" item.
    It should work in this manner:
    a. initial value is derived ( sql stmnt to the DB ) from the value of the "select list" ( which is a dynamic lov );
    b. if user decided to change this value -> click on the popup icon and the list of values will be presented based on the dynamic LOV. Selecting one of those will override the initial value of the item.
    What i do NOT want to do is to submit the page to get this initial value ( from select ).
    Hope it's clear.
    thank you
    Andrew

    I've implemented a solution recently which I think will help you. Put the following Javascript into the HTML Header section.
    * setPageItemSessionData()
    * This function is called to set a page item's html + session
    * data to a specific value.
    * Arguments:
    * pageItemName - the page item to change
    * val - the value to set it to
    function setPageItemSessionData(pageItemName, val)
    try
    /* need to take data passed into this function
    and store in session variable as named in pageItemName */
    /* store in HTML field only here */
    document.getElementById(pageItemName).value = val;
    /* store in session variable - don't really know how this works
    but it does !*/
    var l_Return = null;
    /* get new http post request */
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value);
    /* add http post variable/data */
    get.add(pageItemName, val);
    /* submit post over http - receving end will take data and store
    in session variable */
    gReturn = get.get();
    catch(e)
    alert("setPageItemSessionData: Exception - " + e);
    Create a hidden text item which will be used to contain the selected Select List value (not display value). In my example this is called P162_OUTGRPIDD but it can be called anything you want.
    Now put the following javascript into the Select List's HTML Form Element Attributes cell:
    onchange="javascript:setPageItemSessionData('P162_OUTGRPIDD',this.value);"
    The hidden text element will be changed whenever the Select List is changed. It will be set to the value (not the display value) of the Select List.
    The value of the hidden item is saved in session state (as well as HTML) so that it can be used by the POPUP LOV
    Now in the POPUP LOV item you can reference P162_OUTGRPIDD in the where clause, as the example below shows:
    select sklpin d, sklpin v
    from pdrskl, pdrgrp
    where grpidd1 = grpidd and
    grptyp = 'R' and
    pdrskl.itpidd1 = :P162_ITPIDD and
    grpidd = :P162_OUTGRPIDD and
    bldagtidd1 is null
    order by sklpin asc

  • HT2523 how to make a simple line across the page

    how to mmake a line across

    In what application, running what version of OS X?
    (A Mac cannot run iOS)

  • How to set a session variable

    Hi,
    I would like to know how to set a session variable for the following purpose.
    At the top of my application I have a "Welcome <username>" I'd like it instead to have "Welcome <firstname> <lastname>".
    So the concept would be after the user logs in succesfully this session variable is dynamically set so it can be displayed.

    Hi Scott,
    I realize that I can set items etc in pages. The case I'm referring to is a reference in a template. My template has a "Welcome <user name>" ... so the code looks like "Welcome &APP_USER." Anyway to make it say "Welcome first_name last_name" in the template? Note I'll have to get the first/last names from a query
    Thanks,
    Marty

  • Set VO bind variable on page loading programmatically

    Greetings everyone!
    I use JDeveloper version 11.1.2.3.0
    I am currently trying to get some filtered data from a VO, based on a WHERE clause with a bind variable. This process should be done on page load. I have to set this bind variable with the id of the logged user (the part of getting this id is already achieved and used somewhere else). My current approach is defining a managed bean with pageFlow scope. Inside this i have a method in which i retrieve the id and i set it as the parameter value. The code snippet:
          BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("getUserIdFromUsername"); //getUserIdFromUsername is a method defined in the AppModule and exposed in the client interface
           operationBinding.getParamsMap().put("username", getUserName());
          Object userID = operationBinding.execute();
            setUserId(Integer.parseInt(userID.toString()));
           System.out.println("THE USER ID IS: "+getUserId());
           BindingContainer bindings2 = getBindings();
           OperationBinding operationBinding2 = bindings.getOperationBinding("ExecuteWithParams");  // i've dragged and dropped the ExecuteWithParams operation into the page
           operationBinding2.getParamsMap().put("userId", getUserId());  // userId is the bind variable which i'm talking about
            Object result = operationBinding2.execute();
    Then, i call this method on BeforePhase in the page view. It works, i get the filtered data and the println shows me the correct ID. The problem is that each time i select a row in the table showing the data, the page seems to reload and it always get the selection back at the very first row.
    What am i doing wrong? May be this is not the right approach, as i've seen some other posts about this topic but they are not very clear to me.
    Please advice

    Approach1:
    Drag and Drop an Application  method as Default Method Call Activity, then draw a control flow case from the method to your page.
    In the application module method, implement appropriate logic.
    Approach2:
    Using a combination of client listener and server listener will also help.
    <af:clientListener method="onLoadAction" type="load"/>
    <af:serverListener type="MyCustomServerEvent"
    method="#{backingBeanScope.editBean.onLoadListener}"/>
    function onLoadAction(event){
               /*alert(':::: onSave ::');*/
               AdfCustomEvent.queue(actionEvent.getSource(),
                             "MyCustomServerEvent",
                             true);
           actionEvent.cancel() ;
           actionEvent.stopPropagation();

  • How to use bind variables in the following query

    CREATE OR REPLACE PROCEDURE MMDB.test IS
    sel_qtn VARCHAR2 (10);
    CURSOR PT_QUANTITY IS select * from mmdb.product_tree WHERE QUANTITY_CHECK ='E'
    AND run_id = 100
    a PT_QUANTITY%ROWTYPE;
    BEGIN
    FOR i IN PT_QUANTITY
    loop
    sel_qtn := i.quanttity-1;
    While sel_qtn>=1
    loop
    insert into mmdb.product_tree (BILLING_ACCOUNT_NO ,S_CODE) values (i.BILLING_ACCOUNT_NO ,i.S_CODE||'E');
    sel_qtn :=sel_qtn -1;
    End loop;
    commit;
    end;

    Don't duplicate threads: How to use bind variables in the following query

  • Setting VO bind variable programatically

    Hi,
    We have a panel accordion, which has several panels. Depending on panel's name (text attribute) we need to set the underlining VO bind variable to the name value.
    Could someone point to an example of how to do it?

    use [url http://docs.oracle.com/cd/E14571_01/apirefs.1111/e10653/oracle/jbo/server/ViewObjectImpl.html#setNamedWhereClauseParam%28java.lang.String,%20java.lang.Object%29]setNamedWhereClauseParam  method
    also check {message:id=9904521}
    Edited by: M.Jabr on Nov 28, 2011 8:55 AM

  • Setting VO bind variable using session variable

    Hi,
    I need to get/set VO bind variable using ApplicationModuleImple or ViewObjectImple class. Does Any one know how to do it?
    I have one VO based on query like "select name from users where password = :password ". I had a bind variable to it too. now i want to set it from a session scoped variable. can i do it using ADFContext.getCurrent().getSession().get('username'); ? but somehow I am not able to get the knowledge i.e where to set bind variable. please help.

    Timo thanks for the reply, actually I don't want to do it using data control i.e drag and drop method to a page. Instead i just want to set bind variable to a session varable already got from login page.
    I got the following sollotion but don't know where to put them,
    1.
    FacesContext context = FacesContext.getCurrentInstance();
    ValueBinding vb = context.getApplication().createValueBinding("#{data}");
    BindingContext bci = (BindingContext)vb.getValue(context);
    DCDataControl dc = bci.findDataControl("AppModuleDataControl");
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    AppModuleImpl service = (AppModuleImpl)am;
    ViewObject vo = service.findViewObject("YourViewObject").setNamedWhereClauseParam("nameBindVariable", objectValue);
    vo.executeQuery();
    what is the #{data} in second line ? if you know please let me know.
    Second Solution :
    2- In backing bean code:
    FacesContext context = FacesContext.getCurrentInstance();
    Application fapp = context.getApplication();
    JUFormBinding adfbc = (JUFormBinding)fapp.createValueBinding("#{bindings}").getValue(context);
    DCIteratorBinding iter = adfbc.findIteratorBinding("YourIterator");
    iter.getViewObject().setNamedWhereClauseParam("nameBindVariable", objectValue);
    iter.executeQuery();
    where would I get "YourIterator" ... ? I am still a new at jdev ... ;)

  • How to set a display variable

    Hi all,
    we have oracle EBS 12.1.1 installed on suse linux servers in our setup. one developer is using dev tools to have some graphs displayed while generating reports. all of a sudden we find that the graphs are not getting generated.
    i am told that it is because of the DISPLAY variable in Linux. I am working as a Linux admin and I am not too sure how to set it.
    i went to the company's data center to get to the console of the Linux box. I logged into the GUI and ran these commands
    linux-43x3:~ # echo $DISPLAY
    :0.0
    linux-43x3:~ # export DISPLAY=:0.0
    linux-43x3:~ # xhost +
    access control disabled, clients can connect from any hostsince the display was showing :0.0, there sud not v been any issue in my opinion, but still i chose to run the export DISPLAY command.
    still i find the graphs do not show up. should I run the command as root or should I run it as an apps user? and further if I log out of the GUI will the graphs still work?
    i dont have much experience with oracle apps. please excuse me if this question is too silly

    Hi,
    >but still i chose to run the export DISPLAY command.
    No problem if you set DISPLAY:0.0 AGAIN
    should I run the command as root or should I run it as an apps userRun as both users.
    should I run the command as root or should I run it as an apps userIt'll work, Unless you reboot the whole machine.
    Regards
    Taher

  • Use of bind variables with the oracle db - to improve library cache perform

    Dear Friends,
    We are using oracle 9.0.1.1.1 db server - the performance of the db was pathetic and upon investigation it was revealed that the library cache was over loaded with sql hard parses generated by not using bind variables. We are using vb as a front end with oracle and our connection object in vb is created using ole db for oracle provided by oracle (installed from oracle client custom - programmer option).
    I would appreciate if any body can tell how can we use bind variables in vb to connect to oracle such that the hard parses can be changed into soft parses.
    Your effort to bring some peace in my life is worth comendable and I would be very obliged for your time and help.
    Thanks a lot.
    Bye
    Take care.
    qj

    Generally, you would use bind variables by changing statements that are written like this
    select * from emp where empno=6678 and ename='Jones'
    so that they're written like
    select * from emp where empno=? and ename=?
    How you then bind these question marks to the particular values you want depends on the API you're using (ADO? OLE DB directly?, etc). If you have a support contract, there are plenty of examples for any API on metalink.oracle.com
    Justin

  • How to set ORACLE_HOME environment variables in win 2003

    Can anyone tell me how to set ORACLE_HOME environment variables in Win2003
    Please tell me the significance of that also.It will be really helpful if u can help me out from Path variable seting of JAVA SDK also... Thanks in advance...

    hi
    use this code IN FORMS60 variable in Regedit
    \\server\DATA\store\Forms;
    Rizwan

Maybe you are looking for

  • Creating po in me21n with copy from other po

    Can any one tell the procedure to create PO copying from other PO. Edited by: Csaba Szommer on Jan 18, 2012 8:06 AM

  • Adobe Readerを先に開いておかないと.IEでのpdfリンクが開けない

    質問します. IEでインターネットを利用し.見たいリンクをクリックしますよね. 今まで.それがpdfファイルのリンクでも 自動的にAdobe Readerが起動して表示されていました. ところが.近頃pdfファイルのリンクをクリックすると. 画面が真っ白になって少し時間が経ってから 以下の表示が現れて.IE自体は強制的に終了してしまうんです.↓ iexplore.exe 問題が発生したため.iexplore.exeを終了します. ご不便をおかけして申し訳ありません. 作業中であった場合.その情報

  • Email related to email login info

    I  received an email on 9/21/11 from Verizon(?)..... related to shutting down unused email  accounts , resend login info to [email protected] ...is this a legitimate email from Verizon? Solved! Go to Solution.

  • Game mode swither, Won't switch!!! (X-

    I have just recently come across this problem, while switching to Game mode on my X-fi soundcard a message pops up that reads "You need to restart your computer before the new mode of your audio device will take effect. Do you want to restart your co

  • Are you having trouble with text in InDesign CC?

    My text keeps disappearing when I'm working on a document. To return it, I have to resize the frame or recolour it black. Is it a glitch?