Please help: How to pass variable from main select to subquery

I have a table with four columns (id, status, start_date and end_date) as follows. What I want is to get the difference between the statuses' start_date to find out how long it takes for the ID to change status. Basically getting the difference of the Start_dates of the statuses for the ID.
ID         Status               Start_date          End_date
1         NEW             02-FEB-07        02-FEB-07
1         OLD             04-FEB-07        06-FEB-07
1         BAD             09-FEB-07        14-FEB-07
I had initially thought of doing this
SELECT ID, (SELECT Start_date from tbl where Status = 'OLD' and ID = 1) - (SELECT Start_date from tbl WHERE Status = 'NEW' and ID =1) from tbl where ID = 1
but that would not work since I have more than one id and implementing inside Java will be complicated. Please help me what I need to do .. Thank you

Or this:
SQL> CREATE TABLE t AS (SELECT 1 ID , 'NEW' status, '02-FEB-07' start_date, '02-FEB-07' end_date FROM DUAL
UNION ALL SELECT 1 ID , 'OLD' status, '04-FEB-07' start_date, '06-FEB-07' end_date FROM DUAL
UNION ALL SELECT 1 ID , 'BAD' status, '09-FEB-07' start_date, '14-FEB-07' end_date FROM DUAL
UNION ALL SELECT 2 ID , 'NEW' status, '02-FEB-07' start_date, '02-FEB-07' end_date FROM DUAL
UNION ALL SELECT 2 ID , 'BAD' status, '05-FEB-07' start_date, '10-FEB-07' end_date FROM DUAL
UNION ALL SELECT 2 ID , 'OLD' status, '07-FEB-07' start_date, '10-FEB-07' end_date FROM DUAL
Table created.
SQL> ALTER SESSION SET nls_date_format='DD-MON-RR'
Session altered.
SQL> SELECT ID,
       status,
       start_date,
       TO_DATE (start_date)
       - LAG (TO_DATE (start_date)) OVER (PARTITION BY ID ORDER BY TO_DATE
                                                                   (start_date))
                                                           diff_of_start_days
  FROM t
                                                ID STA START_DAT                                 DIFF_OF_START_DAYS
                                                 1 NEW 02-FEB-07                                                  
                                                 1 OLD 04-FEB-07                                                  2
                                                 1 BAD 09-FEB-07                                                  5
                                                 2 NEW 02-FEB-07                                                  
                                                 2 BAD 05-FEB-07                                                  3
                                                 2 OLD 07-FEB-07                                                  2
6 rows selected.

Similar Messages

  • OBIEE 11g How to pass variable from one prompt to another prompt in dashboard page.

      How to pass variable from one prompt to another prompt in dashboard page.
    I have two prompt in dashboard page as below.
    Reporttype
    prompt: values(Accounting, Operational) Note: values stored as
    presentation variable and they are not coming from table.
    Date prompt values (Account_date, Operation_date)
    Note:values are coming from dim_date table.  
    Now the task is When user select First
    Prompt value  “Accounting” Then in the
    second prompt should display only Accounting_dates , if user select “operational”
    and it should display only operation_dates in second prompt.
    In order to solve this issue I made the
    first prompt “Reporttype” values(Accounting, Operational) as presentation
    values (custom specific values) and default presentation value is accounting.
    In second prompt Date are coming from
    dim_date table and I selected Sql results as shown below.
    SELECT case when '@{Reporttype}'='Accounting'
    then "Dates (Receipts)"."Acct Year"
    else "Dates (Receipts)"."Ops
    Year"  End  FROM "Receipts"
    Issue: Presentation variable value is not
    changing in sql when user select “operation” and second prompt always shows
    acct year in second prompt.
    For testing pupose I kept this presentation
    variable in text object of dashboard and values are changing there, but not in
    second prompt sql.
    Please suggest the solution.

    You will want to use the MoveClipLoader class (using its loadClip() and addListener() methods) rather than loadMovie so that you can wait for the file to load before you try to access anything in it.  You can create an empty movieclip to load the swf into, and in that way the loaded file can be targeted using the empty movieclip instance name.

  • Please help how to pass a JavaBean from servlet to jsp?

    Hi there,
    I have got a dispatch servlet and I want the dispatch servlet to get the data and store it in a JavaBean before dispatching to the appropriate JSP page. However, I don't know how to pass the javabean to the JSP when the servlet forward the request to the JSP. Is ServletContext.setAttribute() the only way to pass the javabean to the JSP page?
    Thank you very much!
    Edmund

    You can use HttpServletRequest.setAttribute(String name, Object javabean) to set the javabean into the HTTP request that you are forwarding to the JSP.
    In the JSP, you can access the Javabean using request.getAttribute(String name) and cast it to the right class.

  • How to Pass Variables from One Application to Another Pop Up Window

    Hi,
    I am wondering if anyone on the list has tried calling up a
    pop up manager, and have two other variables imported for secondary
    usage. I have tried using [Bindable], but this does not seem to be
    working, and I am still getting errors that tells me that the
    variables are "not defined" when it gets passed to another
    HTTPService. I tried embedding the Pop Up Manager in the same
    application as the one that is supposed to "pass the variables,"
    but it no longer acts as a pop up window.
    Could anyone please tell me where I can find the answers for
    this?
    Thanks in advance.
    Here is the code of what I have for my pop up manager:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    title="New Scenario"
    showCloseButton="true"
    width="325"
    height="145" horizontalScrollPolicy="off"
    close="titleWindow_close(event);">
    <mx:Script>
    <![CDATA[
    import mx.events.CloseEvent;
    import mx.managers.PopUpManager;
    import mx.controls.Alert;
    [Bindable]public var message:String;
    [Bindable]public var message2:String;
    private function titleWindow_close(evt:CloseEvent):void {
    PopUpManager.removePopUp(this);
    private function submit_click():void {
    Alert.show(scenario_name.text, "Alert");
    new_scenario.send();
    PopUpManager.removePopUp(this);
    var win:Hello = PopUpManager.createPopUp(this,Hello, true)
    as Hello;
    PopUpManager.centerPopUp(win);
    private function reset_click():void {
    scenario_name.text = "";
    ]]>
    </mx:Script>
    <mx:HTTPService id="new_scenario" method="POST" url="
    http://localhost/simulator/scenario.php"
    useProxy="false">
    <mx:request xmlns="">
    <scenario_name>{scenario_name.text}</scenario_name>
    <message>{message}</message>
    <message2>{message2}</message2>
    </mx:request>
    </mx:HTTPService>
    <mx:Form>
    <mx:FormItem label="Scenario Name:">
    <mx:TextInput id="scenario_name"
    text=""
    maxChars="45" />
    </mx:FormItem>
    </mx:Form>
    <mx:ControlBar horizontalAlign="right">
    <mx:Button id="submit"
    label="Submit"
    click="submit_click();" />
    <mx:Button id="reset"
    label="Reset"
    click="reset_click();" />
    </mx:ControlBar>
    </mx:TitleWindow>

    Hi,
    I am trying to display some data on the Child window that
    would need to take the data from the parent titleWindow, which
    could be drop down menus, text labels or combo boxes. I would need
    to use a HTTPService on the child dialog box to accomplish task I
    think, but the problem is, how would I get the information from its
    parent window? The example I have are all about how the text input
    from the child window gets feed back to the parent.
    Would I need to create a "reverse" declaration or something
    so I can access the information from the parent in the child
    window?
    I hope this makes sense.
    Thanks for your help.
    Alice

  • Please help how to pass the dynamic value to VO -- Urgent.

    Hi,
    I have an Oracle Standard VO( SQL Query). As per my requriemnt i extended standard VO with one new feild.Now i want to query the new VO dynamically.
    How to pass the dynamic values to new query?
    for refence i am giving my old query.
    select
    secondary_inventory_name as SubInventoryName,
    description as Description,
    from mtl_secondary_inventories
    my new Query is like this:
    select
    secondary_inventory_name,
    description,
    Item
    from mtl_secondary_inventories
    where item='123456'
    I want to pass this "where item="123456" as dynamically. please help where i will do the change's.
    Thanks,
    Sekhar.

    Hi,
    thanks pratap for quick response...but i am extending VO from Standard VO.
    I have a Standard VO which contains a bind variable suppose :1.
    I have extended this above standard VO and i want to add another bind variable say :2 to the custom VO.
    Please tell me how will i pass bind parameter value to the bind variable in runtime ?
    what are files i want to change?
    Thanks,
    Sekhar.

  • How to pass data from main vi/exe (sender) to many vi/exe (receivers) with one receiver code/vi?

    Hello all
    I am tring to dev some data distribution system, where one vi gets data from hw to shared variable. Vi compiled to app "sender.exe" The others units (receivers) should receive that data from shared var and write it to different serial ports (configured by user in runtime via control). Number of actually working ports may vary.
    Should (and can?) this "receivers" vi's be the one vi, compiled to app "receiver.exe" and executed many times with different settings (diff serial port number)? // I tried this, second+ execution of receiver.exe just makes existing window active instead of creating new process as it works with other languages.
    Or should i build many different vi (receiver1, receiver2, ... with actually the same content) into different .exe to run them at the same time?
    Or may be the best way to build multi-port receiver with ability to communicate with any number of serial ports? // i dont like this, no code reusage here ))
    The question is complicated with possibility to work via network (one of the reasons to make different exe for receivers) and may be the shared vi namespace may not allow many receiver-side vi's to have the same name?
    In short, it should work as SENDER.exe >> RECEIVER1.exe, 2, 3... i.e. "one to many".
    Asking for a best solution advice.
    Please help)

    ns_create wrote:
    Should (and can?) this "receivers" vi's be the one vi, compiled to app "receiver.exe" and executed many times with different settings (diff serial port number)? // I tried this, second+ execution of receiver.exe just makes existing window active instead of creating new process as it works with other languages.
    To allow multiple instances of the same exe, read this.
    (I don't fully understand your setup, so I won't comment further at this time.)
    LabVIEW Champion . Do more with less code and in less time .

  • How to pass variable from Java to ABAP in BSPs

    Hello experts,
    taking into account the two environments (browser and server) I need to pass information from Java to ABAP.
    After seen this link: Re: View Refresh
    I have tried the next:
    HTMLB:  <input type="hidden" name="myFlag" value="">
    ABAP:   DATA: lv_height TYPE STRING.
    JAVA:   var intXo = readCookie("XEix");
    JAVA:   if ( intXo == 900 )                
    JAVA:   else if (intXo == 725 )            
    ABAP:   lv_height = request->get_form_field( 'myFlag' ).
    ABAP:   IF lv_height EQ 'X'.
    ABAP:     TRAYTAREAS_P = 'TRUE'.
    ABAP:   ELSE.
    ABAP:     TRAYTAREAS_P = 'FALSE'.
    ABAP:   ENDIF. 
    "document.all.myFlag.value" gets the correct value according the condition, but the ABAP code does not recover this value (lv_height is always initial).
    Can you help me with that? I'm not able to see where is the mistake...
    Exist any alternative way to recover in ABAP an JavaScrip value?
    thanks in advance.
    Arnau
    Message was edited by:
            Arnau Mustieles

    Hi Raja
    I think you are appointing to this posted solution:
    HTMLB: <input type="hidden" name="myFlag" value="">
    ABAP: DATA: lv_height TYPE STRING.
    JAVA: var intXo = readCookie("XEix");
    JAVA: if ( intXo == 900 )
    JAVA: else if (intXo == 725 )
    ABAP: lv_height = request->get_form_field( 'myFlag' ).
    ABAP: IF lv_height EQ 'X'.
    ABAP: TRAYTAREAS_P = 'TRUE'.
    ABAP: ELSE.
    ABAP: TRAYTAREAS_P = 'FALSE'.
    ABAP: ENDIF.
    but it doesn't work. Can you detect if there is any evident error there or the process is right?

  • Please Help - How to pass Table objects as input and output parameters using VC++

    Please help me by giving a sample code to call the procedure
    GetClassInstanceProperties from a VC++ application using
    Oracle Objects for OLE
    CREATE OR REPLACE TYPE TY_INST_ID_PROP_PAIR AS OBJECT
    (INST_ID CHAR(38), PROP_ID CHAR(38), VALUE XMLTYPE);
    CREATE OR REPLACE PACKAGE DBMS_PROPERTYSTORE
    AUTHID CURRENT_USER
    AS
         --Used to return the ids from the functions
         TYPE tt_UUIDs IS TABLE OF char(38) index by binary_integer;
         TYPE tt_inst_id_prop_pairs is table of ty_inst_id_prop_pair index by binary_integer;
         PROCEDURE GetClassInstanceProperties(ClassId IN char, Prop_Ids in TT_UUIDs,
    Inst_Id_Prop_Pairs out TT_Inst_Id_Prop_Pair);
    END DBMS_PROPERTYSTORE;
    CREATE OR REPLACE PACKAGE BODY DBMS_PROPERTYSTORE AS
         PROCEDURE GetClassInstanceProperties
              ClassId IN char,
              Prop_Ids in TT_UUIDs,
              Inst_Id_Prop_Pairs out TT_INST_ID_PROP_PAIR
         AS
         BEGIN
              --Return the instanceid,propertyid and values for a certain class
              --only return those properties that in the user supplied Prop_ids table
              FOR I in Prop_Ids.FIRST..Prop_Ids.LAST loop
                   select TY_Inst_Id_Prop_Pair(i.Inst_Id,p.Prop_Id,p.Value) into Inst_Id_Prop_Pairs(I)
                        from TBL_Instance i, table(Prop_Pairs) p
                        where I.Cls_Id.Cls_Id=ClassID
                        and p.Prop_Id = Prop_Ids(I);
              END LOOP;
         EXCEPTION
              WHEN NO_DATA_FOUND THEN
                   raise_application_error(-20100, 'No data found');
              WHEN OTHERS THEN
                   raise_application_error(-20200, SQLERRM);
         END GetClassInstanceProperties;
    END DBMS_PROPERTYSTORE;

    HI
    Go to the lay out of your screen and doublr click on the table control fields, you can get the Properties/Attribute of the screen or table control Fields
    Assing a Group GRP1 for all the fields i n the table control.
    in PBO
    if ok_code = 'INPUT'.
    LOOP AT SCREEN.
    IF screen-grp1 = 'GRP1'.
    screen-input = 1.
    modify screen.
    endif.
    ENDLOOP.
    elseif ok_code = 'OUTPUT'.
    LOOP AT SCREEN.
    if screen-grp1 = 'GRP1'.
    screen-input = 0.
    modify screen.
    endif.
    endloop.
    endif.
    Regards
    Ramchander Rao.K
    Edited by: Ramchander Krishnamraju on Aug 8, 2009 5:27 AM

  • How to pass output from one selection-as input to another selectiion??

    From a user prompt will iniate many user table selections.   And  the outputs  of each table selection will be used as inputs for the next table selection
    I reviewed variable Scope and inner and outer Declare—it would be a great help if some one could give me a  example of the right approach??
    see sample script :
    Thank you so much for your help
    ---------------------------- Section_01_UserInput.sql -------------------------
    -- THIS SECTION OF THE SCRIPT IS TO PROMPT THE USER FOR THE MODEL NAME AND THE ORGANIZATION CODE (e.I...M1,M2,M3...._)
    -- THE ORGANIZATION WHERE MODEL WAS CREATED IS THE ONLY PLACE WHERE YOU WOULD FIND THE BILL_SEQUENCE_ID
    -- THE COMMON ORGANIZATIONS DO NOT HAVE COMPONETS THEY JUST REFERENCE TO THE ORHANIZATION THAT MODEL WAS CREATED
    SET VERIFY OFF
    SET ECHO OFF
    ACCEPT v_assemblyName CHAR DEFAULT myDefaultAssemblyName PROMPT 'Enter Assembly name:'
    ACCEPT v_OrganizationCode CHAR DEFAULT myDefaultOrganizationCode PROMPT 'Enter the Org where the MODEL WAS CREATED :'
    SELECT a.organization_code, a.organization_id, b.inventory_item_id, b.segment1, b.description
    FROM mtl_parameters a, mtl_system_items_b b
    WHERE a.organization_code = '&v_OrganizationCode'
    AND
    b.segment1 ='&v_assemblyName'
    AND
    b.organization_id = a.organization_id;
    SET VERIFY ON
    SET ECHO ON
    ----OUTPUT of the Section_01_UserInput.sql QUERY---
    ORGANIZATION_CODE ORGANIZATION_ID INVENTORY_ITEM_ID SEGMENT1 DESCRIPTION
    M1, 207, *[225957]* , CN927779, Sentinel Custom Desktop
    ----------------------------- Section_02_bom_structures_b.sql ------------------
    -- List all option class Bill of Materials for a single ATO or PTO model
    -- List of bill_sequence_id and all component_item_id's that belong to that
    -- bill_sequence_id
    SELECT a.assembly_item_id, a.bill_sequence_id, b.bom_item_type, b.component_item_id
    FROM bom_structures_b a, bom_components_b b
    WHERE a.assembly_item_id = *['225957']*
    AND
    b.bill_sequence_id = a.bill_sequence_id
    AND
    b.bom_item_type = '2'; -- OPTION Class's are identified by bom_item_type
    ----OUTPUT of the Section_02_bom_structures_b.sql  QUERY---
    ASSEMBLY_ITEM_ID ORGANIZATION_ID BILL_SEQUENCE_ID BOM_ITEM_TYPE BILL_SEQUENCE_ID COMPONENT_ITEM_ID
    *[225957]* , 207 , *[90754]* 2 90754 *[297]*
    *[225957]* , 207 , *[90754]* 2 90754 *[299]*
    *[225957]* , 207 , *[90754]* 2 90754 *[301]*
    ----------------------------- Section_03A_bom_structures_b.sql-------------------
    -- List all the components under the option class
    -- When no components are found with bom_item_type ='4' which means that this assembly has no
    -- components in the bom_components_b because the assembly is a child that is a option class.
    -- We need to run this script with a bom_item_type ='2' and stored the component_item_id into MEMORY_assembly_id
    -- and run script again by read from MEMORY_assembly_id and bom_item_type = '4';
    SELECT a.assembly_item_id, a.organization_id, a.bill_sequence_id, b.bom_item_type, b.bill_sequence_id, b.component_item_id
    FROM bom_structures_b a, bom_components_b b
    WHERE a.assembly_item_id = '297'
    AND
    b.bill_sequence_id = a.bill_sequence_id
    AND
    b.bom_item_type = '4';
    ----OUTPUT of the Section_03A_bom_structures_b.sql QUERY---
    ASSEMBLY_ITEM_ID ORGANIZATION_ID BILL_SEQUENCE_ID BOM_ITEM_TYPE BILL_SEQUENCE_ID COMPONENT_ITEM_ID
    *[297]* 207 *[384]* 4 384 *[185]*
    *[297]* 207 *[384]* 4 384 *[241]*
    *[297]* 207 *[384]* 4 384 *[249]*
    *[297]* 207 *[384]* 4 384 *[4747]*
    *[297]* 207 *[384]* 4 384 *[4749]*
    *[297]* 207 *[384]* 4 384 *[4751]*
    =================================================================================================
    note output FROM EACH SELECT  that needs to be passed to the next SELECT statement are *[ ]* for example *['225957'] see below:*
    ----OUTPUT of the Section_01_UserInput.sql QUERY---
    ORGANIZATION_CODE ORGANIZATION_ID INVENTORY_ITEM_ID SEGMENT1 DESCRIPTION
    M1, 207, *[225957]* , CN927779, Sentinel Custom Desktop
    ----OUTPUT of the Section_02_bom_structures_b.sql  QUERY---
    ASSEMBLY_ITEM_ID ORGANIZATION_ID BILL_SEQUENCE_ID BOM_ITEM_TYPE BILL_SEQUENCE_ID COMPONENT_ITEM_ID
    *[225957]* , 207 , *[90754]* 2 90754 *[297]*
    *[225957]* , 207 , *[90754]* 2 90754 *[299]*
    *[225957]* , 207 , *[90754]* 2 90754 *[301]*
    ----OUTPUT of the Section_03A_bom_structures_b.sql QUERY---
    ASSEMBLY_ITEM_ID ORGANIZATION_ID BILL_SEQUENCE_ID BOM_ITEM_TYPE BILL_SEQUENCE_ID COMPONENT_ITEM_ID
    *[297]* 207 *[384]* 4 384 *[185]*
    *[297]* 207 *[384]* 4 384 *[241]*
    *[297]* 207 *[384]* 4 384 *[249]*
    *[297]* 207 *[384]* 4 384 *[4747]*
    *[297]* 207 *[384]* 4 384 *[4749]*
    *[297]* 207 *[384]* 4 384 *[4751]*
    Edited by: user612347 on Mar 16, 2010 4:21 PM
    Edited by: user612347 on Mar 16, 2010 4:57 PM

    Hi,
    Sorry, it's unclear what you want to do.
    Whenever you have a problem, it helps to be as specific as you can.
    Post a little sampel data (CREATE TABLE and INSERT statements) and the results you want from that data. Since your problem involves parameters, give a couple of sets of parameters, and the results you want for each set, given the same data.
    Are you saying that, after the user enters one set of parameters, you will need to run a variation of this query:
    SELECT  a.assembly_item_id, a.organization_id, a.bill_sequence_id, b.bom_item_type, b.bill_sequence_id, b.component_item_id
    FROM    bom_structures_b a, bom_components_b b
    WHERE   a.assembly_item_id = '303'
    AND
            a.organization_id = '207'
    AND
            b.bill_sequence_id = a.bill_sequence_id
    AND
            b.bom_item_type = '4';several times? What will be different each time? Will the hard-coded strings in the WHERE clause ('303', '207' and '4') be values from the earlier query?
    Do you really want to run this query several times, or would you rather run one query, and have it produce results for all the relevant values? (That would probably be eaisest and less error-prone). When you post your desired results, post what you would most like to see. If something else is acceptable, describe it.
    You can write SQL*Plus scripts to use parameters (substitution variables.
    For example, you can write a query that says:
    WHERE   a.assembly_item_id     = '&1'
    AND     a.organization_id      = '&2'
    AND     b.bill_sequence_id      = a.bill_sequence_id
    AND     b.bom_item_type      = '&3';and call it like this
    @Section_03A_bom_structures_b  303  207  4You can have a query output several such rows (for example:
    @Section_03A_bom_structures_b  303  207  4
    @Section_03A_bom_structures_b  304  298  3
    @Section_03A_bom_structures_b  306  99   4), send all of that output to a SPOOL file, and then execute the SPOOL file.

  • How to pass values from main window to pop-up window?

    I want to pass a value from the main window (1st form) to pop-up window (2nd form). The first form is of name booking.jsp and 2nd form is of name Fund_booking.jsp. I am using window.showModalDialog to open the window. I think, I have written right code in main window to pass the value but even then I am not able to get it on pop-up window. I am not even able to display an alert on pop-up window saying "hi" by writing a function on save Button in pop-up window. The code is as follows:
    On booking.jsp:
    <script>
    function popup()
    var aForm;
    aForm = D_requisition_id.options[D_requisition_id.selectedIndex].text;
    \\Here I have captured value from a drop down box in my main window form and assigned it to the variable.
    alert(aForm);
    var myObject =new Object();
    myObject.Brandcode = aForm;
    alert(myObject.Brandcode);
    window.showModalDialog("Fund_booking.jsp",myObject,"dialogHeight:400px;dialogWidth:420px;");
    </script>
    <button name="B_FundBooking" tabIndex=4 style='POSITION:absolute;LEFT:393;TOP:292;WIDTH:100;height:24;BACKGROUND-COLOR:buttonface' onClick ="popup()">Fund Booking</button>
    On Fund_booking.jsp:
    <SCRIPT>
    var oMyObject = window.dialogArguments;
    var sBrandcode = oMyObject.Brandcode;
    alert(sBrandcode);
    </SCRIPT>
    Even the following alert is not getting displayed in pop-up window;
    <script>
    function ValidateData()
    alert("Hi");
    </script>
    <button name="B_Save" tabIndex=1 style='POSITION:absolute;LEFT:255;TOP:315;WIDTH:75;height:24;BACKGROUND-COLOR:buttonface' onClick ="ValidateData()">Save</button>
    I am using DIV instead of frames in my both forms. I just want to get that value in my pop-up window to write a query based on which data will get displayed in my table of pop-up window.
    Plz help me to solve this problem.

    Well, this is actually a JavaScript question, not a Java question but I can give some hints.
    When you do pop-up windows you need to put JavaScript in the html of the pop-up itself. Data can be passed by creating new fields in the window object, which the popup can access via the window.openner field.
    So, before invoking the popup add any data to be passed to the window object, then the onLoad function in the popup grabs the data.

  • How to pass value from main window to pop up window?

    I want to pass a value from the main window (1st form) to pop-up window (2nd form). The first form is of name booking.jsp and 2nd form is of name Fund_booking.jsp. I am using window.showModalDialog to open the window. I think, I have written right code in main window to pass the value but even then I am not able to get it on pop-up window. I am not even able to display an alert on pop-up window saying "hi" by writing a function on save Button in pop-up window. The code is as follows:
    On booking.jsp:
    <script>
    function popup()
    var aForm;
    aForm = D_requisition_id.options[D_requisition_id.selectedIndex].text;
    \\Here I have captured value from a drop down box in my main window form and assigned it to the variable.
    alert(aForm);
    var myObject =new Object();
    myObject.Brandcode = aForm;
    alert(myObject.Brandcode);
    window.showModalDialog("Fund_booking.jsp",myObject,"dialogHeight:400px;dialogWidth:420px;");
    </script>
    <button name="B_FundBooking" tabIndex=4 style='POSITION:absolute;LEFT:393;TOP:292;WIDTH:100;height:24;BACKGROUND-COLOR:buttonface' onClick ="popup()">Fund Booking</button>
    On Fund_booking.jsp:
    <SCRIPT>
    var oMyObject = window.dialogArguments;
    var sBrandcode = oMyObject.Brandcode;
    alert(sBrandcode);
    </SCRIPT>
    Even the following alert is not getting displayed in pop-up window;
    <script>
    function ValidateData()
    alert("Hi");
    </script>
    <button name="B_Save" tabIndex=1 style='POSITION:absolute;LEFT:255;TOP:315;WIDTH:75;height:24;BACKGROUND-COLOR:buttonface' onClick ="ValidateData()">Save</button>
    I am using DIV instead of frames in my both forms. I just want to get that value in my pop-up window to write a query based on which data will get displayed in my table of pop-up window.
    Plz help me to solve this problem.

    just attach the value with its url for example
    String names="java";
    <a href="# onclick="window.open('file.jsp?name='+names);"></a>

  • How to pass control from main controller to sub controller?

    Hi Experts,
    I have created one controller named "available.do" by which I am calling a view "available.htm". On that view I am showing one Button which says Check Availability. On clicking of this button it shows another view "list.htm". But it is showing new view and old view on same page.
    Second I want to add one button on second view "list.htm" which should perform some function. I don't know how I can achieve this functionality?
    Someone has suggested me that for this I have to create sub controller...but i don't know much about it as I am new in BSP.
    Kindly tell me and paste code so that I can solve my both problems.
    <<Text removed>>
    Thanks in Anticipation,
    Virendra Kedia
    Edited by: Matt on Oct 15, 2011 7:25 AM

    Hi,
    I guess you might have below coding in DO_INIT method,
    me->view_main = 'main.htm'.   "Where VIEW_MAIN is the attribute in you main controller of type STRING.
    you should have below coding in DO_REQUEST of main controller.
    DATA: main TYPE REF TO if_bsp_page.
      me->dispatch_input( ).
    *Create main view.
      main = create_view( view_name = me->view_main ).
    *Set desgin attribute.
      main->set_attribute( name = 'design' value = application->design ).
    *Call main page views.
      call_view( main ).
    *Activate  Sub -controller.
      controller_set_active( controller_id = 'sub_cntrl' active = lc_active ). 
      l_cntl_inst ?= get_controller( controller_id = lv_cntl_id ).  "DATA: l_cntl_inst TYPE REF TO cl_bsp_controller.
    *Call sub-controller.
      call_controller( l_cntl_inst ).
    Please check with this.
    Thanks,
    Chandra

  • How to pass variable from link in email into HTML DB

    On our helpdesk application, we want to send emails to impacted customers, and have them click on a link in the email (that contains their ticket number) to get to a response form in HTML DB without having to copy and paste or re-enter that ticket number. How would I do this? At this point I don't know if the email will come from Outlook or from HTML DB.
    Also, I see that there is a version of HTML DB for Windows machines. Does it interface with MS Exchange?
    Thank you.

    Hi,
    I have a HR Incident Reporting HTMLDB application that sends details of assigned calls to the assignee's email account, detailing the issue and including a URL to the relevant page in the application.
    When the user clicks on the URL (appears as a link in their email) they go straight into the relevant application page (via login screen).
    We use lotus notes, but I see no reason Exchange would work in the same way.
    Cheers,
    Rob Chalton

  • Please Help - How Do I Rip From WMP Directly - Zen Micro

    Is it possible to rip directly from wmp directly to the zen micro? If so, how? I've given up on Mediasource as it won't connect to Gracenote CDDB.. Many thanks in advance..
    Pete

    I'm sure only MediaSource can do it.
    You mentioned that CDDB wasn't working with MediaSource. Did you try the advice here in the Zen FAQ at Nomadness.net?

  • Passing variables from php to flash and the opposite

    Hi guys, im trying weeks now to solve this problem but nothing yet
    If someone could just tell me how to pass variables from flash to php and the opposite i would be thankful!!! Please help!

    I have recently had to learn this, so this may not be the best way but it worked for me
    I suggest looking at the code below stripping out everything you don't need (e.g. the databse stuff) and just get a simple string going back and forward
    have a go and post any problems here and I'll try and help
    in flash i have
    private function getBalanceAndXP():void
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "getBalance";
              variables.fbid = userID;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.addEventListener(Event.COMPLETE, onBalanceComplete);
              loader.load(request);
    private function onBalanceComplete(e:Event):void
              var loader:URLLoader = e.target as URLLoader;
              loader.removeEventListener(Event.COMPLETE, onBalanceComplete);
              var variables:URLVariables = new URLVariables(loader.data);
              _balance = parseInt(variables.balance); // class variable
              _experience = parseInt(variables.experience); // class variable
    public function setBalanceAndXP(balance:int, experience:int):void
                _balance = balance;
              _experience = experience;
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "setBalance";
              variables.fbid = userID;
              variables.balance = _balance;
              variables.experience = _experience;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.load(request);
    and then I have my php file
    <?php
    $func = $_POST["func"];
    $fbid = $_POST["fbid"];
    $balance = $_POST["balance"];
    $experience = $_POST["experience"];
    $numVariables = 0;
    $link = mysql_connect("localhost","username","password");
    mysql_select_db("databaseName");
    if ($func == "getBalance")
              getBalance($fbid);
    else if ($func == "setBalance")
              setBalance($fbid, $balance, $experience);
    mysql_close($link);
    function getBalance($fbid)
              $query = "SELECT balance, experience FROM tableName WHERE fbid = '".$fbid."'";
              $result = mysql_query($query);
              $row = mysql_fetch_row($result);
              writeVariable("balance", $row[0]);
              writeVariable("experience", $row[1]);
    function setBalance($fbid, $balance, $experience)
              $query = "UPDATE tableName SET balance = ".$balance.", experience = ".$experience." WHERE fbid ='".$fbid."'";
              mysql_query($query);
    function writeVariable( $name, $value )
              global $numVariables;
              if ( $numVariables > 0 )
                        echo "&";
              echo $name . "=" . urlencode($value);
              $numVariables++;
    ?>

Maybe you are looking for