Query a detail block

Dear members,
I use Forms 6i c/s, with a 8.1.7 database.
I have two blocks, with a master-detail relation between them.
When I try to search for records in the detail block (Enter-Query / Execute-Query), I get only one record: the one that was synchronized from the master block.
I'd like to find a way to get all the records when querying the detail block, while keeping the master-detail relation.
Any idea ?
Is it just the "Copy value from item" on the detail block side that narrows the records to just one ?
Or can I modify something in the triggers/procedures created by the relation ?
Thanks for your help.

I understood your idea of a separate search block, but >one thing remains unclear: where do I populate the >results ?You still query the original M-D blocks to get results by setting the master/detail block's default-where property and execute_query on the block respectively.
You need to concate the user inputs into a string for default-where as user may input ename and sal two fields to find out how many departments and dependents info.
The separate dialog even allows user to input detail block's ename, sal and master block's loc fields to get the specific department, which default M-D cannot do this.
In addition, default search button does not allow you set one master or detail block default-where and execute-query, then go to detail or master block to set default-where and execute-query.
You do a simple testing on tables of dept and emp, then you will sense this.
Good luck.

Similar Messages

  • Querying a detail block

    I have a tabbed canvas. one has some baisc employee info. the other has some detail. even tho the two tabs derive from the same table, i have a master-detail relationship. but i'm no able to do queries in the detail tab. eg: if the phone numebr field if i enter query '203%' and execute, i only see the display on this block but the master block is not populated.
    any help would be appreciated.
    lalit

    Hi Lalit
    If the Both the blocks are based on same table then manually create relationship
    b/w them , like go_block(detail) and Execute_query with the where clause .
    If default relation ship is created
    using wizard then check out for the coding .
    Otherwise there should not be any problem .
    With Regards
    Harish
    null

  • Problem in query detail block

    hello all,
    i have a form having master and detail block. in master we have store_cd and location code(primary key in master table),
    based on that detail recrds fetch in detail block. perfectly fine. but when i query within detail block records then it show no record found. please tell me what can be wrong.
    detail table primary key is (store_cd, location_code and storage_co) , in realtion i mentioned
    masterblock.store_cd=detailblock.store_cd and masterblock.location_cd=detailblock.location_cd
    Thanks
    yash

    yes, there are records in detail table... table structure(master and detail block)
    SQL> desc ivt_store_mst
    Name Null? Type
    STORE_CD NOT NULL VARCHAR2(3)
    STORE_DESC NOT NULL VARCHAR2(25)
    LVL_REF_CD NOT NULL VARCHAR2(6)
    STORE_TYPE VARCHAR2(2)
    Primary key(store_cd,lvl_ref_cd)
    SQL> desc ivt_storg_mst;
    Name Null? Type
    STORE_CD NOT NULL VARCHAR2(3)
    STORAGE_SRL_NO NOT NULL NUMBER(10)
    STORAGE_CD VARCHAR2(10)
    ITEM_CD NOT NULL VARCHAR2(10)
    BAY_NO VARCHAR2(10)
    SHELF_NO VARCHAR2(10)
    ROW_NO VARCHAR2(10)
    TIER_NO VARCHAR2(10)
    BIN_CARD_NO VARCHAR2(10)
    INSERT_DT DATE
    GRN_NO VARCHAR2(12)
    GRN_FIN_YR_CD VARCHAR2(8)
    PLEVEL_REF_CD NOT NULL VARCHAR2(6)
    PGRN_LEVEL_REF_CD VARCHAR2(6)
    Primary key(store_cd,storage_cd, plevel_ref_cd)
    relation property is: noo-isolated
    deferred: false
    autoquery: false
    block join condition based on detail_blk1.stor_cd=masteblk.store_cd
    when i query from master block , ALL detail blocks ITEMS are displaying. but when i query again among detail block items then, no record found base on query field(detail blk: item_cd which is base table field).
    when i query in detail block for all records then Every time only one item display with same item_cd...
    if further some info required, plz mention

  • Querying a Detail Master relation

    Hai All,
    Can anyone suggest me how to get the Find window option based on the Detail block.
    Presently I am creating a view based on the required column from the Master and the detail block, creating a find window based on this view, from that I am tracking the header Id and getting the required master detail information.
    Is there any othere way to directly query the detail block from the find window and get the Master Detail Relation.
    Thanks In Advance........

    Hi Lalit
    If the Both the blocks are based on same table then manually create relationship
    b/w them , like go_block(detail) and Execute_query with the where clause .
    If default relation ship is created
    using wizard then check out for the coding .
    Otherwise there should not be any problem .
    With Regards
    Harish
    null

  • 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;

  • Autofill detail block based on query

    Hi experts/Gurus
    I have 3 tables
    1-pr_mst
    2-pr_trn
    3-hr_mst
    Em_code is a common key between theses tables.
    on my form table 1 and 2 are the base main tables, due to the relationship, when i enter em_code on table 1 and query it, it shows data on both the table. Its a normal behavior in Master Detail block in forms.
    When user enter em_code at form and there is no data found in table 2, obviously it show blank data block related to the table 2 and shows data in table 1 block, now i want an em_code details which stores in the table 3 automatically load in memory and populated in detail block.
    Is it possible ? and how can i do this. suggest me a best or anybody can give example on emp/dept
    regards
    Anwer

    I'm not sure if i understand you correctly. You want to have an additional relation between block 1 and block 3? If so, just create it, each block can have more than one relation as master.

  • Detail blocks in tab pages not queried automatically

    Hi
    I have some generated forms with the following layout:
    - in the content canvas top, the master block
    - below the master block (in the same content canvas), a tab canvas with 2 (or more) pages with detail blocks
    When I query the master block, the detail blocks are not automatically queried, the user must navigate to them to make the automatic query work.
    I found out that it is something related to the blocks not being in the same canvas. But visually, they are in the same canvas, I would like that the detail blocks were queried automatically.
    Is this possible? I think this layout is very common and useful, I am sure Designer has some way to do this.
    Thanks
    Luis Cabral

    Hi
    I found it - I just set BSCSCP preference correctly, and now it works fine!

  • Update detail block based on FROM QUERY

    I have 2 blocks in master-detail relation. The master is based on a table, the detail on from query. The Insert works fine... but whenever i want to update any field from the detail block, the items (text, lists, whatever) don't allow any updating.
    Is there some workaround?
    Thank you for the help
    NR

    RTM on blocks based on from-query.
    If I recall well, it says that you shoud write the DML code in on-insert, on-update and on-delete triggers - and, anyway, if I do not remember well the manual, that's what I do.
    So, the on-insert trigger should have an insert into <my_dml_table>...
    The on-update trigger sould have an update <my_dml_table>... where ... And there's a thing: you may have the rowid of <my_dml_query> fetched - which would be the best - or use some primary key for that table for update (not so good performance).
    The on-delete trigger somewhat like the on-update trigger.
    Moreover, I believe it would be better to have procedures for on-insert, on-update and on-delete grouped in one package in the database - again, this is what I use to do.

  • Query forms based on detail block

    My question is pretty simple: Is it possible to query a form (Forms [32 Bit] Version 6.0.8.11.3) based on a detail block? Let me explain my problem! I have a table called REQUISITION and of its field is STATUS_CODE. Then I have another table called STATUS that have the following fields: CODE, NAME, DESCRIPTION, PHASE, etc. The join condition between REQUISTION and STATUS is REQUISITION.STATUS_CODE = STATUS.CODE. On my form, all of the fields come from table REQUISITION but the problem is that we have over 30 different status and my user can't remember their names and phase. So I inserted two display fields on the forms and wrote a post-query trigger to populate the field with their corresponding names and phases. But now my end user are complaining that the fields don't allow queries to be performed which prevents them to use a query to know all requisitions that are on phase "Procurement" which corresponds to four different status_code. So I though in inserting the fields PHASE and DESCRIPTION into table REQUISITION and write a trigger that would populate those field every time the STATUS change but that would cause a problem when lets say STATUS 01 is part of PHASE "Procurement" then comes next week the company decides that is not longer part of phase "Procurement" but now it is part of PHASE "Purchasing" they would go the form based on table STATUS and change the field PHASE of the corresponding STATUS that they want. But now I have this data on another table holding information that is no longer valid. Sure I could write another trigger to change field REQUISITION.STATUS_PHASE whenever there is a change on STATUS.PHASE but wouldn't that be too much bookkeeping? Would be so much easier if I could query my forms based on the detail block (this case table STATUS and master block table REQUISITION)?
    thanks so much in advance for any thought! Btw, I am open to other suggestions too!!!!!
    gleisson henrique

    if I understood you correctly, you can do this manually. what I mean is,
    when the end user picks phase "Purchasing", you can change the where clause on the master block and execute the query to get the desired results
    e.g.
    v_cod varchar2(200) := 'STATUS_CODE in (select code from status where phase = ''Purchasing'')';
    begin
    set_block_property(requisition_blk,default_where,v_cod);
    execute_query;ofcourse you have to change "Purchasing" in the previous code to the item that holds the user inputs
    hope this is helpful
    Edited by: Mohammed H. on Sep 19, 2008 6:45 PM

  • Master-Detail relationship and querying back from the detail block

    Hello friends,
    Using oracle forms 6i. I have a multi data block. On the block there is a header and detail section. There is master detail relationship present in these blocks. I have a sequence defined, which generates an auto-number.
    Now in the detail section say I have 4 records all of which are say invoices and I am populating the details about it. On the 'save' button I have defined a logic which generates an auto- number or a unique number for all the 4 records in the detail section. The unique number is shown in the header section in a text-field.
    Now when I query (F11 and then Ctrl+F11) with the help of the unique number i see all the 4 records under it in the detail section. But when I query with the help of one of the 4 records in the detail section it says "fetching more than a single row." I know the same unique number is there for all the 4 records and in the header section I am displaying "number of items displayed" to be 1. That is why the error. But I want that to remain one. How exactly can I develop this functionality of querying the unique number in the header section from the detail block?
    Please help as soon as possible.

    Hi,
    I'd suggest to check this tutorial:
    http://www.oracle.com/technology/obe/obe_as_10g/bi/forms/formsmasterdetailobe.htm
    Having a relationship between data blocks, coordinates dml actions in both, so no coding is needed to save/update/delete records, forms built-ins do the work.
    hope this is useful,
    Hugo

  • Data missing from Detail Block after query

    Hello all,
    I have created a form with a master and detail block. The master data is on a content canvas the detail data is on a stacked canvas which lies on the content canvas. Before you enter the form a find window appears and asks the user to enter criteria to limit the data shown on the main form or just enter the main form. When I put in criteria to bring up more than one record for the master block the first record shows up fine but when I move to the next record the detail block goes blank. When I go back to the first record the detail block is still blank. I first thought this was a problem with the relationship but the deferred and automatic query are set to NO. I am confused at why this is happening, please help.
    Mike

    Dmytro,
    Thank you for replying to my post. I set the automatic query to yes for the block relationship and I am still having the problem, the deferred coordination property is set to no. If you have any other ideas I would appreciate the help. Could this be because of something that I have put in a trigger on the detail block.
    Mike

  • Oracle Forms : Master Detail : Cannot query detail block

    MY requirement is: when user enters records in master block, the corresponding records should be displayed in the detail block. (Detail block is just for viewing).
    Master block is a database block based on a custom table. All fields are enetereble in this block.
    Detail block is a a database block based on view which is built joining the custom table(on which master block is built) & a standard table. None of the fields in detail block are editable. they are just display only. For detail block, set the Key Mode=Non-Updatable, Enabled a field as Primary Key.
    I have created a relation between the 2 blocks. (Deferred=No, AutoQuery=No, Delete Record Behaviour=Isolated.). There is a join between master table & this view.
    But when I enter record in master block & save. the detail block records are not displayed. (Message : No Navigable Items in Detail Block).
    Yes, there are no navigable items in detail block, because its just for viewing purpose. How can this be achieved.
    Thanks,
    Naveen

    Thanks for your inputs. I got the solution for this. Earlier all items in the block were DISPLAY_ONLY. Now, I have selected them as TEXT_ITEMS (even though they are not updatable). It is working fine now. Thanks.

  • Query based on a non-database item in master/detail block

    Hi,
    I have a master/detail block, and in the master the block in have non database control item which displays the user name. Now i would want to retrive all the master/detail records based on the control item. Is that possible? How can i do it?
    Any help would be appriciated.
    Thanks
    Kavitha

    use the set_block_property (default_where) and the execute_query built-ins. more info in the online help

  • Unable to see the values in detail block

    Hello,
    I have a master detail block, when I query the form, I am unable to see the values for a particular field(Column), all other columns appear properly in the details block, Upon checking the same table(s) in SQL ( by using the JOIN defined in the where clause of the relationship in Forms) , it shows the relevant records for all fields. So what could be wrong with the Form, please advise.
    Thanks
    FM

    IQ wrote:
    I have just checked the field its a non-database field which is being used as a LOV column to display a value derived from LOV. How do I make this populate at Query time, as obviously this works when the Form is in a insert mode but not for Query mode. How to make it work for Query ? As it for LOV column and non-database filed, ignore my first suggestion.
    Does your non-database filed has associate any column ?
    For example, you have SUPPLIER_ID (database column) and SUPPLIER_NAME (non-database column). SUPPLIER_NAME has LOV column. And when selecting supplier name from LOV value also assign at supplier_id.
    Now to show supplier name when querying, you have to write POST-CHANGE trigger at supplier_id. like
    SELECT ASSC_CODE INTO :MST_SUPPLIER.ACC_CODE
    FROM ACC_SUB_SUB_CONTROL
    WHERE ASSC_ID=:MST_SUPPLIER.SUPP_ASSC_ID;Hope this helps

  • How can I get a detail block to requery after a database change?

    Hi, I have a master/detail form. When the status of the master record changes, I need to update a date in one of the detail records. If I use SQL to update the detail row in the database in the ON-CHANGE trigger of the master block, how can I get the detail block to requery to show the change? When I try doing a go_block from any of the ...UPDATE triggers, it says it is restricted.

    wjpenfold,
    Do you have a "Relationship" defined between your Master and Detail blocks? If so, you simply need to requery your master block and the detail block will automatically be requeried. If you can't use a relationship, then you can use can create a timer in the trigger that updates the database and then in the When-Timer-Expired (WTE) trigger you can go to the detail block and execute a query. For example:
    /* Sample On-Change trigger */
    DECLARE
       timer_id  TIMER;
    BEGIN
    ....your code here that performs the update....
       /* Now create an instance of a timer */
       timer_id := Create_Timer ('upd_detail',1,NO_REPEAT);
    END;
    /* Sample Form Level When-Timer-Expired trigger */
    DECLARE
       timer_id   TIMER;
    BEGIN
       -- Find the timer first
       timer_id := FIND_TIMER('upd_detail');
       IF NOT ID_NULL(timer_id) THEN
          GO_BLOCK('DETAIL_BLOCK');
          Execute_Query;
       END IF;
    END;Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

Maybe you are looking for

  • The problem is occurred with J2ee server node which is disabled it from MMC

    Dear SAP Consultants, The problem is occurred with J2ee server node which is disabled J2ee server node from MMS Console and the abap work process is working fine but the dispatcher is yellow status and I can login to the abap system but Iu2019m not a

  • Case id-4615052271.

    Hi,CCHSAP191092 .As i am facing lot of trouble with my Laptop. My name is smruti sanjeeta jena and i have purchased the hp laptop dv series, so i can work and as HP is the best brand, but from the starting i am facing lot of difficulties. as you can

  • How can I edit a photo in Photoshop Elements and have the edit appear in Windows 7, My Pictures?

    In Windows XP Pro, any edit I made to a photo in Photoshop Elements 10 appeared automatically in that photo in My Pictures.   This does not happen in my new Windows 7 computer.  Can I change that and have the edit from PE10 appear in My Documents/My

  • HT1911 I forgot my passcode on my ipod, how do I reset it

    my son put a passcode onto his ipod and forgot what it is.... I'm not computer savey and can't figure out how to reset it?

  • Control_file_record_keep_time

    Hi, Im using Oracle 10.2.0.1 on RHEL 4, I was getting a following error in alert log file: kccwnc: following controlfile record written over: RECID #245937 Recno 59937 Record timestamp 10/06/10 13:06:14 Thread=1 Seq#=245937 Flags: <produced by archiv