Post Query Problem

Hellow
I have a master-detail blocks.
Now I want to run the detail block according to certain query that returns MORE than onw row a time.
I used a cursor to resolve this prob.
Still having problem in quering the detail when I query the Master.
Any comment??
Note: I can populate the detail using a Stored procedure. But this SP needs an input(Bind Variable in Master block) to be passed as a parameter.
Can it work like this? How?
Regards
Tariq

The data block wizard is capable of creating two data blocks with the master/detail relationship. Create the master block first, then create the detail block and set up the relationship in the wizard. When you make the layout for the detail block, specify how many rows you want to see in the detail, and tell it to display a scroll bar in case the query returns more than that number of rows. You should not need to create a cursor or do any specific programming to implement a master/detail form.
null

Similar Messages

  • Post query and lov problem

    I wonder if anyone can help me with this problem. I have a non database text item which holds a school name dependent on the school id. I have a post-query trigger to populate the school_name field so that the school_name is shown immediately. I also have a LOV on this field in case the school has to be updated.
    The problem I have is that when I query the data block the list of values pops up automatically and won't let me out of the screen until I have selected a school. I only want this LOV to appear when the user requests it.
    Can anyone advise me on how to get around this problem, maybe I'm using the wrong type of trigger?
    thanks,
    Ian

    In the LOV properties, set Automatic Display to false

  • Post Query(Image Problem)

    Thanx to all of you and specially to
    ??Sajanka and Sudha all time good freind.
    Problem: I want to load an image
    with post query trigger on the block.
    I am trying it by
    filename:=get_file_name(PathVariable,FileFilter=>'*.*');
    read_image_file(filename,'any','block.image_item');
    But when the trigger is fired window's dialog box for the file is opened and I have to pick the file from the relative directory.
    Please help me for this.
    Again thanx!
    Imran Amjad

    Well me and Sanjana are the same ! Anyway the best way if it is possible is to keep all your image files in a separate directory and add that directory to the forms60path string in the registry, then all you need is the file name not the entire path.
    Read_Image_File(file_name,'bmp',image_item);
    If that is not possible then try changing the filter to the file name. See if that helps you. The first way is the best way to do.

  • LEFT OUTER JOIN, Problem in POST-QUERY TRIGGER

    Hi,
    Please guide for the following
    I wrote below query in POST-QUERY Trigger of a TABULAR DATA BLOCK, having only one text item, called INVENTORY_ITEM
    select c.cat||' '||s.subcat||' '||l1.lvl1 ITEM INTO :DATABLOCK.INVENTORY_ITEM
    from itemcat c
    LEFT OUTER JOIN itemsubcat s on (c.catid = s.catid)
    LEFT OUTER JOIN lvl1 l1 on (s.subcatid = l1.subcatid)
    When I compile the module an error is generated
    *" Encountered the symbol 'LEFT' when expecting one of the following ,; for group having intersect minus order start union where connect ".*
    Above query is working fine in ORACLE SQL DEVELOPER .
    Any solution please.
    Regards,

    Difference

  • Problem with post query trigger

    Hi,
    I have a multi record block and there is a post-query trigger on it. Based on values of this block I populate other values over the other control block.
    I wrote code in post-query trigger and when I execute the query and go to last but one record. The values in the control block are from last record instead of last but one record. Pls help me to fix
    Thanks,

    if you want to see the data in the control block synchronized with the database block then use the WHEN-NEW-RECORD-INSTANCE and not the POST-QUERY.
    with the POQ you add additional data (in non-basetable-items) to the records in the database block

  • 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

  • Post-trigger problem in master detail form.

    I have designed a master detail form having two data blocks.
    in detail data block there is a post-query.
    when i tried delete one record in master block
    an error occurred ie
    'frm-40654. Record is updated by another user
    re-query to see changes'.
    in detail block there are 3 non database items.
    when i delete the post-query trigger the record is deleting properly.but the post-query trigger is also needed to display the non database item values. please give me a solution to tackle this problem.

    Hi,
    Even though yout items are non-database items, when you assign a value to them forms sets the block status to "CHANGED".
    Add the following lines add the end of your post-query trigger to reset the block status to "QUERY"
    set_record_property (GET_BLOCK_PROPERTY('YOUR_BLOCK_NAME',CURRENT_RECORD)
    ,name_in('system.cursor_block')
    ,STATUS
    ,QUERY_STATUS
    Hope this helps,
    Hugo

  • Designing LOV Query Problem

    Hello APEX people,
    I posted my problem here:
    Designing LOV Query Problem
    What I have is a sequence like this:
    CREATE SEQUENCE
    DR_SEQ_FIRST_SCHEDULE_GROUP
    MINVALUE 1 MAXVALUE 7 INCREMENT BY 1 START WITH 1
    CACHE 6 ORDER CYCLE ;
    What I need would be a SQL query returning all possible values oft my sequence like:
    1
    2
    3
    4
    5
    6
    7
    I want to use it as a source for a LOV...
    The reason why I use the cycling sequence is: My app uses it to cycle scheduling priorities every month to groups identified by this number (1-7).
    In the Admin Form, I want to restrict the assignment in a user friendly way - a LOV.
    Thanks
    Johann

    Here ist the solution (posted by michales in the PL/SQL forum):
    SQL> CREATE SEQUENCE
    dr_seq_first_schedule_group
    MINVALUE 1 MAXVALUE 7 INCREMENT BY 1 START WITH 1
    CACHE 6 ORDER CYCLE
    Sequence created.
    SQL> SELECT LEVEL sn
    FROM DUAL
    CONNECT BY LEVEL <= (SELECT max_value
    FROM user_sequences
    WHERE sequence_name = 'DR_SEQ_FIRST_SCHEDULE_GROUP')
    SN
    1
    2
    3
    4
    5
    6
    7
    7 rows selected.

  • POST-QUERY TRIGGER

    Hello.
    I'm a newbie here.
    I'm currently studying Oracle Form Builder and I'm a student.
    I've encountered this problem where I need to create a post-query trigger in a data block that counts a total number of rows in a particular item using a display item.
    I'm know I need to use the INTO clause to populate the display item but I got stuck.
    Please help.
    Thank you very much..

    First of all your code to calculate the total rows returned from a query is wrong.
    Try this one in a Post-Query Trigger
    DECLARE
    total_rows_returned NUMBER;
    BEGIN
    SELECT COUNT(*)
    INTO total_rows_returned
    FROM table_name;
    :block_name.display_item := total_rows_returned;
    END;
    Good Luck
    Saadat Ahmad
    Oracle Developer

  • Post-query trigger ? save changes?

    I have a similar problem to that posted by 'nova' on Dec. 27, 2000. I have a form generated by Designer. The problem is that upon subsequent querying (F8 pressed twice), it asks me if I want to save my changes, when I have not made any changes.
    I looked in the generated code for the post-query trigger and found SET_RECORD_PROPERTY(:SYSTEM.TRIGGER_RECORD, 'NEW_CUST', STATUS, QUERY_STATUS) which is apparently not the problem, according to this prior post. I am at a loss and have tried everything I could think of.
    What else could be causing this? I checked to see if there were any items being set in the property sheet to default values, and removed the defaults - that did not work.
    ??? I would greatly appreciate any assistance. Thanks.

    Hi Pina,
    my similar problem I have solved like this:
    Post-Record trigger:
    BEGIN
    *** this is important to test the record status - without this I had the same problem
    IF :SYSTEM.Record_Status='INSERT' THEN
    IF :TRANZIT_ZADAJ.ID_SADZBY_TV_PRENOSOV IS NULL THEN
    :TRANZIT_ZADAJ.ID_SADZBY_TV_PRENOSOV:=:SADZBY_ZADAJ.ID;
    END IF;
    END IF;
    END;
    You can check Pre-... and Post-... triggers
    if there are any items being set to any values.
    I hope this will help you.
    Helena

  • Post-query trigger order for data blocks in master detail relationship

    Using Forms [32 Bit] Version 10.1.2.2.0 (Production) Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production.
    I have the following problem with a form I am working on. It has a master data block with multiple detail data blocks. I am trying to create a post-query trigger on one of these detail blocks that will do a select using the value of a field from another of the detail blocks.
    The problem is that the post-query trigger of the data block I am trying to do the select with is firing before the post-query trigger of the block I need the value from is firing. I tested by just putting in a display message and having it return the value of the id I am tryign to use. Right after I do a query on the form, I get the messages saying:
    "Error: cannot find price for id:" and there is no id, and then the message from the other datablocks post-query saying, "id is: 123"
    Is there a way to change the order that the datablocks are queried? Or should I be using a different trigger to do this?

    Do you mean as it is displayed in the object navigator? It's not the first block under the data block section, but it is above the other block that is exceuting before it, so I assumed the order in that did not matter.
    EDIT: Thanks Magoo! That solved the issue.
    Edited by: a small rabbit on Sep 4, 2009 11:28 AM

  • How to stop trigger function when in post query?

    Hi All,
    I have a problem, not able to find the solution.
    I have created a form with 10 field items.
    For a field item called RECEIVED_15G, i have created a trigger:WHEN-VALIDATE-ITEM, it works fine as per my requirement.
    The problem is that i want this trigger to work only when i run the form , that when system is in NORMAL mode.
    I don't want this trigger to work after i do execute query, even here the system is in NORMAL mode.
    So how do i make it to work ??
    Is it possible to stop that trigger work after i click execute query (Something that i can code in Post query) ??
    Help me . Thank You.
    Oracle Forms 6i,
    Oracle DB 9i.

    Hi
    pls share with us the code my guess ; the When-Validate-Item (WVI) trigger is firing because you are setting a value in an item from post-Query Trigger>
    Note: just assign a name in a display item in post-query trigger DONT assign an id or any db item.
    Amatu Allah

  • Post query giving error

    Declare
    cursor fin_ACNTs IS
    SELECT aCODE,dr,cr,seq
    FROM acnts
    where CCODE = :xH_ccode
    and Tcode = :XH_tCODE
    aND tNO = :xh_Tno
    order by seq;
    total_rows NUMBER;
    the above query will return 2 or 3 rows. for example,
    aCODE DR CR SEq
    P30737 1907.600 .000 B1
    P30737 .000 1907.600 B2
    I have 3 rows wise control fields on my form canvas
    r1c1 r1c2 r1c3 r1c4
    r2c1 r2c2 r2c3 r2c4
    r3c1 r3c2 r3c3 r3c4
    & I want to Store the above query result in Such way that
    the 1st row returned should be saved in r1c1 r1c2 r1c3 r1c4
    and the 2nd row returned in r2c1 r2c2 r2c3 r2c4
    if the query returns 2 rows
    i tried to incorporate it in thiS way, but needs SOme help;
    declare
    cursor fin_ACNTs IS
    SELECT aCODE,dr,cr,seq
    FROM acnts
    where CCODE = :xH_ccode
    and Tcode = :XH_tCODE
    aND tNO = :xh_Tno
    order by seq;
    total_rows NUMBER;
    begin
    FOR i IN fin_ACNTs LOOP
    :ctrl.Rc1 := i.aCODE;
    :ctrl.R[i]C2 := i.dr;
    :ctrl.R[i]C3 := i.cr;
    :ctrl.R[i]C4 := i.seq;
    num_total_rows := fin_ACNTs%ROWCOUNT;
    END LOOP;
    end;
    while compling the trigger am getting the errors;
    Error 49 line 15 column 5
    Bad bind var :ctrl.R
    Error 103 line 15 column 5
    Encountered th symbol "[" when expecting one of the following
    := . ( @ % ; indicator

    TYVM, Mr. Kuba,
    those 4 rows r1c1....did get filled properly. I have now 1 more problem. about this form so,
    I have a columnar tables
    inventotry_header (Inv_head) and
    inventory_detail (Inv_detail)
    in post-database-commit i am saving some details in to a 3rd table, ACNTS
    Inv_head is linked to inv_detail thru primary-foreign key, table ACNTS is independant.
    i have joined inv_head==>ACNTs in forms.
    i wrote this post-query Suggested by you. i want to display ONLY the control fields r1c1.....
    derived from the acnts table in post query and keep acnts table fields hidden.
    the acnts table should just be saved in the background(in post-database-commit) and
    its values will be displayed on form thru the control fields.
    but when i make the visible property of the acnts table fields to "NO", the post query result does not display
    the control fields r1c1.... and on querying, at first record it gives error,
    FRM-40106 No navigable items in destinations block
    and why i dont want to use the acnts tables for display, because i want to assign & display the control fields
    as i enter the details in inv_head and inv_detail, in the sequence of r1c1 r1c2 r1c3 r1c4....
    which i dont think will be possible with acnts tables (which is a linked actual db table).
    hope i have made it clear.

  • Sir how I avoid I this error FRM-40735: POST-QUERY trigger raised unhandled

    Hi master
    Sir this error crate may problem for me
    FRM-40735: POST-QUERY trigger raised unhandled exception ORA-01403
    sir how I avoid I this error and show my message
    or system not show this error and bypass this error
    please send me code how I avoid this error
    thanks
    aamir

    There may be many causes of this error. You better diagnose and remove them.
    1- A field length may be less than what your query return a data into it.
    2- A POST-CHANGE trigger on any data may return un-desired data (character into numrice field, longer value than a field etc).
    likewise.
    Regards
    Sayeed
    [email protected]

  • Post query giving messages

    Hi all i need help
    I have a database block and in that i an a non database item which i am using it for display purpose and i am getting the for the non database item thru the post query.
    After i retreive my block status is changing and when i immediately press save button without changing any records its giving me 2 records saved message.
    how can i supress this?
    BEGIN
    SELECT DISTINCT W_VLV_FNCT_CD INTO :WVG.W_VLV_FNCT_CD FROM WH_VALVES WHERE
         W_VLV_NUM = :WVG.W_VLV_NUM;
    EXCEPTION WHEN OTHERS THEN
         NULL;
    END;
    /*SET_RECORD_PROPERTY :system.TRIGGER_Record,'WVG','STATUS','QUERY_STATUS');*/
    :WVG.W_VLV_FNCT_CD COLUMN IS A NON DATABASE ITEM.
    Thanks
    -Samsam

    Hi,
    Do two things First check that when ur form opens no field in ur form is getting value from anywhere. May be through parameters or through when new form instance.
    Second Do not use exception When others use exception
    when no record found. Try these things. hoping that first point will solve ur problem.

Maybe you are looking for

  • I have downloaded creative cloud but I do not have the creative cloud icon on my computer?

    I have a membership to Adobe and have access to all the CC programs through the Icon "Adobe Application Manager". But I do not have a Creative Cloud icon in my applications? I also cannot sync fonts from Typekit as it says "Desktop font sync is not a

  • COST CENTER CHNAGES FOR OPEN PO"S BEST APPROACH

    Dear All, we are changing the cost center for open PO's kindly tell us the best approach how to do it for all open PO's line items for open PO's are 4000. we will totally block the old PO's and change the PO's with NO GR and IR immediately, but what

  • Entry in /etc/hosts.allow for insecure VNC?

    I read the ssh wiki article which teaches to add an entry to /etc/hosts.allow for sshd.  I am know that tunneling vnc through sshd is the way to go security wise, however, there are cases where I need to switch on un-encrypted vnc for the purposes of

  • Upgrade in 7.1.2 : requires a restauration ! Why ?

    Hello, I'm not fluent in english, so I'll do my best to explain the issue ;-) Yesterday I tried to performed the upgrade of my iPad in 7.1.2 (from 7.1.1). When my iPad restarted I was asked to plug it to my computer (with iTunes icon displayed on the

  • "Found New Hardward Wizard" tells me I Cannot install this hardware

    When I plug my ipod in the "Found New Hardward Wizard" appears. It displays: cannot install this hardware An error occurred The data is invalid After this the ipod does not appear in My Computer, I have looked on Device Manager in Universal Serial Bu