Restricting Query in master detail situation

I got two tables and three forms 1)master-detail 2)a selection form based on detial table.
When we enter data in master form i.e deptno want to open a selection form with restricting query only to those records that is entered in master from.
I want to know how to restrict data in selection form.Bit confusing,
Thank You,
Zubyr

add a parameter to your detail form, and set the default-where property of your block.
you can reference parameters directly in the where clause of the block:
deptno = :parameter.deptno
call your detailform from the masterform with a paramlist
declare
xParamlist paramlist;
begin
xParamlist := Get_Parameter_List('PARAMLIST');          
IF (id_null (xParamList)) THEN
xParamList := create_parameter_list ('PARAMLIST');
ELSE
destroy_parameter_list (xParamList);
xParamList := create_parameter_list ('PARAMLIST');
END IF;
Add_Parameter(xParamlist,'EMPNO',TEXT_PARAMETER, :master.deptno);
call_form('detailform',NO_HIDE,NO_REPLACE,NO_QUERY_ONLY,xParamList);
end;
regards

Similar Messages

  • Auto Query in Master Detail Form using dynamic page doesn't work

    I created a Master-Detail form, and implement AutoQuery using a dynamic page
    with the following code :
    <HTML>
    <BODY>
    <ORACLE>DECLARE
    nre_ VARCHAR2(100);
    BEGIN
    nre_ := emp_nre;
    if nre_ is not null then
    net_portal.Popula_Agregados(nre_);
    net_portal.Popula_Docs_Agregados (nre_);
    htp.p('<iframe id=myFrame name="myFrame" frameborder=0 width="250%"
    height="300"
    src="/pls/portal/PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=
    3
    388118140&p_arg_names=_show_header&p_arg_values=NO&p_arg_names=_cad_nre_cond&p_a
    rg_values=%3D&p_arg_names=cad_nre&p_arg_values='||nre_||'">
    </iframe>');
    end if;
    EXCEPTION
    WHEN OTHERS THEN
    htp.p(SQLERRM);
    END;
    </ORACLE>
    </BODY>
    </HTML>
    It works fine when we access the first time to the page, but if i press the
    save button after inserting or updating a detail record, the header record is
    lost. How can i avoid this situation ?

    I changed query:
    select
    Replace(
    '<img src="#IMAGE_PREFIX#ed-item.gif" border="0" alt="EditMap" usemap="#editmap***id***"></img>
    <map name="editmap***id***">
    <area shape="rect" coords="0,0,16,16" href="http://apex.oracle.com/pls/otn/f?p=&APP_ID.:'
    || decode ( type, 'FOLDER', '33', '22' )
    || ':&APP_SESSION.::&DEBUG.::P'
    || decode ( type, 'FOLDER', '33', '22' )
    || '_ID,P'
    || decode ( type, 'FOLDER', '33', '22' )
    || '_CALLING_PAGE:' || id || ',&APP_PAGE_ID." ></area></map>' ,
    '***id***', id
    ) Edit,
    id,
    type,
    name,
    decode ( type, 'FOLDER', 33, 22 ) target
    from tThe idea is - each img uses its own map.
    It works now.
    Check:
    http://apex.oracle.com/pls/otn/f?p=20980:13
    Lev
    Edited by: le on Nov 3, 2010 11:11 AM

  • Af:query for master detail

    Hi Experts,
    Can we have an af:query to show master detail data ?
    What we generally have is af:query showing records of 1 table. What i want is for the records that get populated from af:query in the master table, i want to show the records in the detail table of the row selected
    any idea ?
    thnks

    Thank you NewBee. It worked and am able to get the detail information from the master table. I am struggling with another implementation. I have 3 radio buttons in the global template which I am referencing in all my pages.
    The template has 3 radio buttons. Contacts, Plans and Users. The three queries are completely different from one another.
    On click of Contacts, I should display the respective af:query for Contacts, Plans and Users without displaying the resultant table. This query panel will be global to all the pages.
    I have tried setting it as follows:
    <af:panelGroupLayout layout="vertical"
    id="pt_pgl3"
    rendered="#{baseBean.searchContactsSelected == 'true'}"
    visible="#{baseBean.searchContactsSelected == 'true'}">
    <af:query id="qryId1" headerText="Search" disclosed="true"
    value="#{bindings.GloablSearchByContactsVOCriteriaQuery.queryDescriptor}"
    model="#{bindings.GloablSearchByContactsVOCriteriaQuery.queryModel}"
    queryListener="#{bindings.GloablSearchByContactsVOCriteriaQuery.processQuery}"
    queryOperationListener="#{bindings.GloablSearchByContactsVOCriteriaQuery.processQueryOperation}"
    resultComponentId="::contactSearch:md1"/>
    <f:subview id="contactSearch">
    <jsp:include page="/contactsSearchResults.jspx"/>
    </f:subview>
    <af:panelGroupLayout>
    I have tried various implementations to the best of my knowledge but its not rendering. Is it possible to navigate to a different jspx on click of Search button of af:query. This will give me an opportunity to display different pages based on the Search action and keeping the search on a global level.
    Hope I was clear in explaining the issue
    Thanks!

  • WHEN-TREE-NODE-SELECTED need 2 Execute-Query on Master-Detail data block

    I optimize tree using this link
    http://andreas.weiden.orcl.over-blog.de/article-29307730.html_+
    For huge amount of data (Accountings)
    All i need for now is
    WHEN-TREE-NODE-SELECTED need 2 Execute-Query on the data block
    DECLARE
    htree ITEM;
    node_value VARCHAR2(100);
    BEGIN
    IF :SYSTEM.TRIGGER_NODE_SELECTED = 'TRUE' THEN
    -- Find the tree itself.
    htree := FIND_ITEM ('BL_TREE.IT_TREE');
    node_value := FTREE.GET_TREE_NODE_PROPERTY( htree, :SYSTEM.TRIGGER_NODE ,  ftree.node_value  );
       GO_BLOCK ('GL_ACCOUNTS');
       set_block_property('GL_ACCOUNTS', DEFAULT_WHERE , 'ACCOUNT_ID ='|| node_value  );
    EXECUTE_QUERY;
    END IF;
    END;The above code is working fine 4 the detail block which is *'GL_ACCOUNTS'*
    when i substitute is Master block which is 'GL_ACCOUNTS_TYPES' it doesn't display all data
    Help is Appriciated pls.
    Regards,
    Abdetu...

    Hello
    In WHEN-TREE-NODE-SELECTED i modified the following code :_
    DECLARE
            htree ITEM;
           node_value VARCHAR2(100);
           parent_node FTREE.NODE;
    BEGIN
      IF :SYSTEM.TRIGGER_NODE_SELECTED = 'TRUE' THEN
      -- Find the tree itself.
      htree := FIND_ITEM ('BL_TREE.IT_TREE');
      -- Get the parent of the node clicked on. 
                  parent_node := FTREE.GET_TREE_NODE_PARENT ( htree, :SYSTEM.TRIGGER_NODE );
           GO_BLOCK('GL_TYPES');
                set_block_property('GL_TYPES', DEFAULT_WHERE , 'TYPE_ID ='|| parent_node  );
                  EXECUTE_QUERY;
      -- Get the detail of the parent node
          node_value := FTREE.GET_TREE_NODE_PROPERTY( htree, :SYSTEM.TRIGGER_NODE ,  ftree.node_value  );
               GO_BLOCK('GL_ACCOUNTS');
               set_block_property('GL_ACCOUNTS', DEFAULT_WHERE , 'ACCOUNT_ID ='|| node_value  );     
                   EXECUTE_QUERY;
          END IF;
    END;
    FRM-40350 : Query caused no records to be retrieved but i have records in the data base ...!
    Well, Do u think that's because in ur package i retrieve only the detail block ?
    Regards,
    Abdetu...

  • Master-detail: one detail row with multiple columns

    Hi All,
    I have a normal master-detail situation in the databse, in the form however all detail rows should be displayed in one single row, using more columns. The number of details are limited, so I can use a predefined number of text-items.
    Any ideas on how to implement this?
    Regards,
    Michiel

    create a function that returns your details. e.g. :
    function get_detail (P_PK, P_rownum) ...
    let's use the example dept and emp. Your master is dept. Your detail is emp. deptno is the PK for the master table.
    you have in your form multi-records of dept and maybe 5 items for employees. The name of the text-items TI_data_1 .. TI_data_5. In the post-query-trigger you code :
    :DEPT.TI_data_1 := get_detail (:DEPT.DEPTNO, 1);
    :DEPT.TI_data_2 := get_detail (:DEPT.DEPTNO, 2);
    if you need more columns create a loop and use the built-in COPY for assigning the detail-values to the text-items.
    the get_detail e.g. is a select-statement:
    SELECT ENAME
    FROM EMP
    WHERE DEPTNO = P_PK
    AND rownum = P_rownum
    ORDER BY EMPNO
    try it
    Gerd

  • Master-detail: detail field not displayed after changed by master field

    I want to use the Depends on item with Clear/refresh value functionality in a master detail situation. Within the same group it is no problem to use the setter method of a field to change a second field and then displaying this new value. But in the detail group, I can not select items from the master group as a depends on item.
    In the setter of the master field, the value in a field for each row in the detail (table layout) is updated. The only problem is that this updated value is not displayed, the old value doesn't change. When saving the changes, the displayed value is committed to the database. When de updated field is not displayed at all, the correct value is saved, so I know the detail field is updated.
    How can I make sure the displayed value in the detail is displayed after changeing a master field? I already gave the detail field the correct partial trigger.

    Wouter,
    I guese you don;t see the changed value when you display the detail item because after the depends on item update changed the detail item, JSF procesing continues and the detail table changes are sent to the server which will override again the detail item attriibute, resetting it to the old, still displayed value.
    So, the trick is to get PPR working. Make sure the partialTYriggers property of the detail item is set to the value of the id property of the master item. If it still doesn't work, try setting the partial triggers property on the table, instead of the individual item.
    Steven Davelaar,
    JHeadstart team

  • Cannot Forward - Master-Detail

    Scenario:
    In a master-detail situation where there are contacts and notes, I want to forward to the master level when the save button is pressed.
    Using the Struts Page Flow Diagramer I create a Forward from notes - to > contacts. Then I edit the notes uix page and add an event-handler for the Commit event. (<submitButton event="Commit")
    Specifically;
    1. Insert inside handlers - event
    2. Name the event - Commit
    3. Insert inside event - Commit
    4. UIX servlet - Go - FowardContact1
    Rebuild and run the app. Proceed to the detail level, press save and it commits the transaction but it does not forward.
    What am I doing wrong???
    Thanks,
    BG...

    Bill,
    You should not need to create a UIX event handler for this. The generated page, already includes a save button that commits, right?
    All you need to do is create the forward and name it "Commit". By creating an event handler, the event-based forwarding meachinism no longer works.
    Steven Davelaar,
    JHeadstart Team.

  • Master-Detail Form - implementing some thing like Post-Query trigger

    Hi all,
    I am struggling to implement an eqivalent of a post-query trigger in Oracle Forms. Please bear with me as I am trying to explain in detail what the problem is.
    Here is my situation.
    I have three tables EMP, DEPT and LOCATION. I created a Master/Table pages on EMP and DEPT.
    Basic relationships.
    Each LOCATION has one or more DEPTs; Each DEPT is at one and only one LOCATION.
    Each DEPT has one ore more EMPs; Each EMP is assigned to only and only DEPT.
    Not getting too complicated, here are the table layouts:
    LOCATION:
    ID number(10,0) not null,
    NAME varchar2(20) not null
    DEPT
    ID number(10,0) not null,
    NAME varchar2(20) not null,
    LOC_ID number (10,0) not null foreign key from LOCATION
    EMP
    ID number(10,0) not null,
    NAME varchar2(20) not null,
    DEPT_ID number (10,0) not null foreign key from DEPT
    Assume I have all the constraints, BIU triggers, sequences defined properly.
    I am using the APEX page wizard to create a Master/Detail Form on DEPT and EMP. The first page is the Master Report on DEPT. I want to display the Location Name on this page also. Because the Master Report allows
    you to change the query, I was able to add the Location Name as part of the
    query. This was very simple.
    Select a.name "Department_Name",
    b.name "Location"
    from dept a, location b
    where a.loc_id = b.id
    Moving on, In the Master Detail Form, I would like to get the Location Name as part of the first Region (Dept Region).
    In this region, I would like to include the Location Name also. So my first region on the Master Detail form includes:
    Dept Id: ________
    Dept Name: _______
    Location Name: __________
    As Region are automatically populated using using a Fetch Row from EMP table (Automated Row Fetch) on an After Header process point, I don't have a way of including the Location as part of query. So I created a Region level Item called Location Name, made it Display only.
    In the old SQL*Forms, or Oracle Forms days, I used to use a Post-Query trigger, or Post-Change trigger to fire on the Loc_Id column to populate the Location Name. Simple fetch like:
    Select name
    into :P80_location_name
    from location
    where loc_id = :P80_loc_id
    However, I am struggling to implement some thing simple like this in APEX. Tried creating a processes, computatations etc, but nothing is working.
    I have seen some previous responses to fetching values from a foreign table
    using a button or AJAX script, but this should be very basic. What am I
    missing here?
    Appreciate any insights.
    Thanks.
    John

    Hi John,
    I'm not too familiar with the post-query triggers in Oracle Forms, but the use of a List of Values (LOV) on your LOCATION table might do the trick for you. If you create a dynamic LOV based on your LOCATIONS table, it can then be referenced by the LOC_ID item on the Master-Detail page, to display the Location Name. You could try doing the following:
    1. Create a new dynamic LOV, LOCATIONS, using a query similar to the following:
    select Name d, ID r
    from LOCATION
    order by 1
    2. Edit the "Create" button on the Master report page, and in the "Optional URL Redirect" section set "Request" to CREATE. Click Apply Changes, to save the setting.
    3. Edit the LOC_ID item on your Master-Detail page, and set the following:
    * in the "Name" region change the "Display As" setting to Select List
    * in the "Label" region change the Label to Location Name.
    * in the "List of Values" region set the "Named LOV" to LOCATIONS
    * in the "Read Only" section, set the condition to Request != Expression 1, and set Expression 1 to CREATE.
    Click Apply Changes to save the settings.
    When you run the pages now, the Location Name field will appear as Read-Only when editing a selected Master row. The item will appear as a Select List when the user clicks "Create" on the Master page, to create a new Master row.
    I hope this helps.
    Regards,
    Hilary

  • Master Detail Form - How 2 update a field in the Detail form using a query?

    Hello,
    I have a master detail form with, each master record having a fixed(6) number of detail records. One of the fields in the detail record is the PART_DESCRIPTION field. I am trying to update this field by querying Table_X. TABLE_X is in the format of (desciption id, description). Description id runs from 1 to 6.
    When the form displays, the PART_DESCRIPTION field for the 6 detail records needs to be automatically populated with the six values of description stored in Table_X. How can this be done?
    Tried using session storage objects, but made no headway.
    Would greatly appreciate pointers on how to go about doing this.
    Thanks.
    Dev

    If you are on a Portal Version lesser than 3.0.9.8.3, then please try the following to populate
    the PART_DESCRIPTION field.
    Steps:-
    1> Edit the form and go to the Additional PL/SQl section and put the following code in the
    "...after displaying the page area" :-
    declare
    type t_vc_arr is table of varchar2(4000) index by binary_integer;
    l_arr_desc t_vc_arr;
    l_form_name varchar2(200);
    l_form_state varchar2(500);
    begin
    l_form_name := p_session.get_module().get_name();
    l_form_state := p_session.get_value_as_varchar2(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => '_FORM_STATE'
    if l_form_state = 'QUERY_AND_SAVE' then
    select description
    bulk collect into l_arr_desc
    from <schema>.table_x;
    htp.p('
    <script>
    var descArr = new Array();
    var Fidx = 1;
    var formObj = document.WWVM'||p_session.get_id()||';
    var fieldName = "'||l_form_name||'.DETAIL_BLOCK.PART_DESCRIPTION.0";
    for i in 1..l_arr_desc.count loop
    htp.p('descArr['||to_char(i-1)||']="'||l_arr_desc(i)||'";');
    end loop;
    htp.p('
    for (var i=0; i < formObj.length; i++){
    if (formObj.elements.name == fieldName+Fidx){
    formObj.elements[i].value = descArr[Fidx-1];
    ++Fidx;
    htp.p('</script>');
    end if;
    end;

  • How to query the master block based on one of the values in detail block

    Hi,
    In version 6i forms, I have a field in data block which is not set as a database item. I am using that field to store a value from detail block. If I want to query the form using that field (which represents one of the values from detail block), how do I do that? Any pointers?
    TIA,

    Do you want to query a master, which contains a specific detail? If so, here's an example how you could do it with a PRE-QUERY-trigger:
    DECLARE
      vcQuery VARCHAR2(4000);
    BEGIN
      IF :MASTERBLOCK.THE_DETAIL_SEARCH_ITEM IS NOT NULL THEN
        -- Build up an exists Sub-Query
        vcQuery:=' MASTERBLOCKID IN (SELECT FK_TO_MASTERBLOCK FROM DETAILTABLE WHERE DETAIL_COLUMN=''' || :MASTERBLOCK.THE_DETAIL_SEARCH_ITEM|| ''')';
      END IF;
      SET_BLOCK_PROPERTY('MASTERBLOCK', DEFAULT_WHERE, vcQuery);
    END;

  • Master-details query to XML file?

    Hi:
    I'm new in XML and Oracle. I want to create XML file from two tables (master-details).
    I made a small serach and tried some examples:
    Say we have these tables:
    CREATE TABLE "TEST_XML"
    (     "ID" NUMBER,
         "NAME" VARCHAR2(15),
         "AMOUNT" NUMBER,
         CONSTRAINT "TEST_XML_PK" PRIMARY KEY ("ID") ENABLE
    CREATE TABLE "TEST_XML2"
    (     "ID2" NUMBER,
         "NAME2" VARCHAR2(20),
         "AMOUNT2" NUMBER
    ALTER TABLE "TEST_XML2" ADD CONSTRAINT "TEST_XML2_FK" FOREIGN KEY ("ID2")
         REFERENCES "TEST_XML" ("ID") ENABLE
    INSERT INTO TEST_XML VALUES (1,'A',50);
    INSERT INTO TEST_XML VALUES (2,'B',30);
    INSERT INTO TEST_XML VALUES (3,'C',70);
    INSERT INTO TEST_XML2 VALUES (1,'AA',10);
    INSERT INTO TEST_XML2 VALUES (1,'AB',20);
    INSERT INTO TEST_XML2 VALUES (1,'AC',20);
    INSERT INTO TEST_XML2 VALUES (2,'BA',10);
    INSERT INTO TEST_XML2 VALUES (2,'BB',20);
    INSERT INTO TEST_XML2 VALUES (3,'CA',20);
    INSERT INTO TEST_XML2 VALUES (3,'CB',40);
    INSERT INTO TEST_XML2 VALUES (3,'CC',10);
    I want a query to create XML file contains data from TEST_XML table and for each row the related data from TEST_XML2 table.
    I did some tries (working in iSQL*PLUS):
    SET SERVEROUTPUT ON
    DECLARE
    v_ctx DBMS_XMLGEN.ctxType;
    v_file Utl_File.File_Type;
    v_xml CLOB;
    v_more BOOLEAN := TRUE;
    BEGIN
    -- Create XML document from query.
    v_ctx := DBMS_XMLGEN.newContext('select id,name,amount,cursor (select id2,name2,amount2 from test_xml2 t2 where t2.id2=t1.id) val from test_xml t1');
    DBMS_XMLGEN.setMaxRows(v_ctx, 10);
    DBMS_XMLGEN.setRowsetTag(v_ctx, 'CLAIM');
    -- Output XML document to file.
    v_file := Utl_File.FOpen('TEST_DIR', 'test1.xml', 'w');
    WHILE v_more
    LOOP
    v_xml := DBMS_XMLGEN.GetXML(v_ctx,0);
    EXIT WHEN dbms_xmlgen.getNumRowsProcessed(v_ctx) =0;
    Utl_File.Put(v_file,v_xml);
    END LOOP;
    Utl_File.FClose(v_file);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SUBSTR(SQLERRM,1,255));
    Utl_File.FClose(v_file);
    END;
    But hte output wasn't as I wanted:
    <CLAIM>
    <ROW>
    <ID>1</ID>
    <NAME>A</NAME>
    <AMOUNT>50</AMOUNT>
    <VAL>
    <VAL_ROW>
    <ID2>1</ID2>
    <NAME2>AA</NAME2>
    <AMOUNT2>10</AMOUNT2>
    </VAL_ROW>
    <VAL_ROW>
    <ID2>1</ID2>
    <NAME2>AB</NAME2>
    <AMOUNT2>20</AMOUNT2>
    </VAL_ROW>
    <VAL_ROW>
    <ID2>1</ID2>
    <NAME2>AC</NAME2>
    <AMOUNT2>20</AMOUNT2>
    </VAL_ROW>
    </VAL>
    </ROW>
    <ROW>
    <ID>3</ID>
    <NAME>C</NAME>
    <AMOUNT>70</AMOUNT>
    <VAL>
    <VAL_ROW>
    <ID2>3</ID2>
    <NAME2>CA</NAME2>
    <AMOUNT2>20</AMOUNT2>
    </VAL_ROW>
    <VAL_ROW>
    <ID2>3</ID2>
    <NAME2>CB</NAME2>
    <AMOUNT2>40</AMOUNT2>
    </VAL_ROW>
    <VAL_ROW>
    <ID2>3</ID2>
    <NAME2>CC</NAME2>
    <AMOUNT2>10</AMOUNT2>
    </VAL_ROW>
    </VAL>
    </ROW>
    <ROW>
    <ID>2</ID>
    <NAME>B</NAME>
    <AMOUNT>30</AMOUNT>
    <VAL>
    <VAL_ROW>
    <ID2>2</ID2>
    <NAME2>BA</NAME2>
    <AMOUNT2>10</AMOUNT2>
    </VAL_ROW>
    <VAL_ROW>
    <ID2>2</ID2>
    <NAME2>BB</NAME2>
    <AMOUNT2>20</AMOUNT2>
    </VAL_ROW>
    </VAL>
    </ROW>
    </CLAIM>
    Notice that for each details (from TEST_XML2) there is <VAL> tag which I don't need beside i want a query which is applicable on all environments.
    May anyone help me please......
    Regards,
    Saad

    The following looks like it produces your desired output. I used the WITH to simulate your two tables so I didn't have to CREATE them. This runs on 10.2.0.1. I'm not sure what bugs you are referring to as SQL/XML is stable in 10g that I have seen. I'm sure some bugs exist somewhere in it, just not with this usage. Just start with the SELECT statement to run on your system.
    WITH test_xml AS
    (SELECT 1 ID, 'A' name, 50 amount FROM DUAL UNION ALL
    SELECT 2, 'B', 30  FROM DUAL UNION ALL
    SELECT 3, 'C', 70  FROM DUAL),
    test_xml2 AS
    (SELECT 1 ID2, 'AA' name2, 10 amount2 FROM DUAL UNION ALL
    SELECT 1, 'AB', 20  FROM DUAL UNION ALL
    SELECT 1, 'AC', 20  FROM DUAL UNION ALL
    SELECT 2, 'BA', 10  FROM DUAL UNION ALL
    SELECT 2, 'BB', 20  FROM DUAL UNION ALL
    SELECT 2, 'BC', 20  FROM DUAL UNION ALL
    SELECT 3, 'CA', 20  FROM DUAL UNION ALL
    SELECT 3, 'CB', 40  FROM DUAL UNION ALL
    SELECT 3, 'CC', 10  FROM DUAL)
    SELECT XMLElement("CLAIM",
             XMLAgg(
               XMLElement("ROW",
                 XMLForest(id "ID",
                           name "NAME",
                           amount "AMOUNT"),
                 (SELECT XMLAgg(XMLElement("VAL_ROW",
                                 XMLForest(id2 "ID2",
                                           name2 "NAME2",
                                           amount2 "AMOUNT2")))
                          FROM test_xml2 t2
                         WHERE t2.id2=t1.id)
      FROM test_xml t1This solution works in any environment where you can issue a SQL statement from, be it SQL*Plus, PL/SQL, Java, etc.

  • Post query trigger problem in master detail oracle forms

    Hello experts,
                        I am new in oracle forms n using Fission middleware 10g with oracle forms 11g at windows 7 platform.
    I have made a master detail form using a tab canvas.There is a database column STUDENTID and it is in my student tab with a TBL_STUDENTENTRY data block.Now I Have an another tab named previous_education with TBL_STUDENT_PREVIOU_EDU datablock here there is also a database column STUDENTID and corresponding field in my  previous_education TAB under TBL_STUDENT_PREVIOU_EDU  datablock.Now i want to add a display item to show  student name corresponding to STUDENTID.For this I have tried to make a select query in TBL_STUDENT_PREVIOU_EDU data block POPST_QUERY TRIGGER.
    begin
    select STUDENTNAME into :TBL_STUDENT_PREVIOU_EDU.STD_NM   from TBL_STUDENTENTRY where STUDENTID=:TBL_STUDENTENTRY.STUDENTID;
    end;
    But, This trigger is not fired at runtime,Please suggest me what is going wrong and give me the solution.
    Thank You
    AADITYA.

    http://www.club-oracle.com/forums/post_query-problem-in-oracle-forms-t9751/#post23794 ,  This is the link at where  I have tried to show my problem with the help of an image,Please get the link:
    thanx
    regards Aaditya.

  • Query  button in Master/Detail form

    Hello All,
    I created a Master / detail form...looks good for a blind query and for a specific column value...
    The problem is When the user selects query button ,how do I show records that the logged in user has created.
    Am already storing username in the table when the user inserts new record.
    Appreciate if you could send code ..if that's the choice to fix my issue..
    Thanks in advance
    Babu

    Hi,
    Write the following code in 'Query' event of the 'Query' button in your form ..
    p_session.set_shadow_value(p_block_name => 'DEFAULT',
    p_attribute_name => 'A_USER_ID',
    p_value => portal30.wwctx_api.get_user,
    p_language => PORTAL30.wwctx_api.get_nls_language);
    doQuery;
    Replace 'A_USER_ID' with name of your user id field . I hope you have selected this field in your form and if not select this field & hide it in the form to make this code to work.
    -Krishnamurthy

  • Query mode of Master Detail Form

    I have a master-detail form.
    I'm passing parameters to that form to autoquery data.
    Everything works fine but "Next" button in a detail block.
    I'm getting:
    An unexpected error occurred: ORA-06502: PL/SQL: numeric or value error: NULL
    index table key value (WWV-16016).
    After autoquery LASTIN_SET variable of DEFAULT block is set "5" (number of rows in detail block).
    When I click on "Next" button LASTIN_SET variable is set to "0" instead of "5" and that causes a problem.
    So, somehow LASTIN_SET is not preserved between clicks.
    In fish_size_form master-detail form
    ... before displaying the page
    shrimp.p_set_parameter_fish_size(p_session,
    p_block_name,
    p_object_name,
    p_instance,
    p_event_type,
    p_user_args
    This is a code of shrimp.p_set_parameter_fish_size
    p_session in out nocopy portal92.wwa_api_module_session,
    p_block_name varchar2,
    p_object_name varchar2,
    p_instance varchar2,
    p_event_type varchar2,
    p_user_args varchar2
    is
    sess_store portal92.wwsto_api_session;
    status varchar2(80);
    station varchar2(80);
    date_time varchar2(80);
    sample varchar2(80);
    species_code varchar2(80);
    form_state varchar2(100);
    begin
    form_state := p_session.get_value_as_varchar2(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => '_FORM_STATE');
    if form_state = 'QUERY_AND_SAVE' then
    sess_store := portal92.wwsto_api_session.load_session(
    p_domain => 'sfnrc',
    p_sub_domain => 'shrimp');
    status := sess_store.get_attribute_as_varchar2(p_name => 'status');
    if status = 'apply' then
    station := sess_store.get_attribute_as_varchar2(p_name => 'station');
    if station is not null then
    p_session.set_shadow_value(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_O_S_M_O_STATION__ID_K',
    p_value => '='||station,
    p_language => portal92.wwctx_api.get_nls_language );
    end if;
    date_time := sess_store.get_attribute_as_varchar2(p_name => 'date_time');
    if date_time is not null then
    p_session.set_shadow_value(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_O_IN__SAMPLE_IN__DATE_TIME_K',
    p_value => '='||to_char(to_date(date_time,'yyyy/mm/dd hh24mi'),'yyyy/mm/dd hh24:mi'),
    p_language => portal92.wwctx_api.get_nls_language);
    end if;
    sample := sess_store.get_attribute_as_varchar2(p_name => 'sample');
    if sample is not null then
    p_session.set_shadow_value(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_OBSERVED_IN__SAMPLE_NUMBER_K',
    p_value => '='||sample,
    p_language => portal92.wwctx_api.get_nls_language);
    end if;
    species_code := sess_store.get_attribute_as_varchar2(p_name => 'species_code');
    p_session.set_shadow_value(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_S_I_PROJECT_SPECIES_CODE_K',
    p_value => '='||species_code,
    p_language => portal92.wwctx_api.get_nls_language );
    sess_store.set_attribute(p_name => 'status',p_value => 'done');
    sess_store.save_session;
    p_session.save_session;
    fish_size_form.wwv_master_gensys_1(
    p_block_name => p_block_name,
    p_object_name => p_object_name,
    p_instance => p_instance,
    p_event_type => p_event_type,
    p_user_args => p_user_args,
    p_session => p_session );
    end if;
    end if;
    end;
    What I'm missing here.
    Aantoliy.

    Say, I click on Update Push button. This will invoke a LOV that will occurs 5 times and then display the header and detail record.
    Even if, I am able to get the records in the canvas, I am not able to update the records of the master. The record_status is in INSERT mode of the header block. Interestingly, if i click 2nd time on update button and then get the records after executing LOV, the query enters the query mode and I am able to update the records then.
    Please suggest how to overcome the problem on a sigle click on UPDATE button.

  • Master/Detail query problem

    I have two VO, masterVo and detailVo, which assoicated with a VL.
    I create a page to query the masterVo and show the result master data and related detail data.
    Can I add a query criteria to filter the detailVo?
    Now I can only set where clauses in masterVo, is it possible to set where clauses both in masterVo and detailVo?

    I don't use query region for my master/detail data query, because the query result is in hgrid region on the other page.
    So I use controller to send the query criteria into AM for query. In masterVoImpl.java, I combine query
    criteria to Where clauses to initiate query. I have one query criteria belong to detailVo attr, How can I put the detailVo criteria
    and masterVo query criteria at one query?
    Thanks a lot.
    Louis

Maybe you are looking for