Multi query block

Dear all

I have a form with a primary block and two child block (Multi Record), three blocks have the common field MPC. My query is, in one child block, I have two color fields & Qty color can be repeated in this block. Same color can therefore n several times in the block and Qty.

In another child block I have qty & color when I get color then my qty must be completed involving the amount of the first block that is having the same color. How can I do it. I didn't save the block. So I have the query block.

I know that we cannot write a query like this
Select colour, sum (tot_qty) of: Block1 where: block1.colour =:block2.colour. Please tell me the best possible solution in detail because I'm not a very technical savvy. Waiting for your answer.

Thanks in advance

Name of the table - MPC_WORKING
Detail_block1
Detail_block2

Detail_block1 has the color and quantity
Detail_block2 has the color, but the amount I have to summarize the amount of detail_block1) so I need a query something like this

In fact, it is true that POST to write data to the database but does not commit. So, if we can write data to the database we can run the query to retrieve data from database according to our crieteria. But as I said above POST use in when-validate-item, so we cannot use it at WHEN-VALIDATE-POINT because it is a process restricted to use WHEN-VALIDATE-ITEM trigger.

What you have to do is. Suppose you have 3 blocks in your form. Block1 and Block2, Block3.
1. create a trigger in BLOCK2 asked A TIMES-NEWS-BLOCK-INSTANCE on at the block level and triggering just use post built like that...

POST;

2. now you BLOCK3 you can create a trigger on the color field to remove the table from the block2 amount. Integrated by POST because its already in the database.
So, simply create a trigger on the color of the BLOCK3 called WHEN-VALIDATE-ITEM field, and then you can write your query in this trigger like this...

Suppose the table name you used for block2 is my_table.
-- Replace the table and field name from you actual structure.
SELECT NVL(SUM(QTY,0))
INTO :BLOCK3.QTY
FROM MY_TABLE
WHERE COLOUR_FIELD_NAME =:BLOCK3.COLOUR_FIELD_NAME
-- Any more condition if there is requirement.

Thus, by this query it will show you the amount that you entered in BLOCK2 which not engaged. I hope it is clear now.

-Clément

Tags: Oracle Development

Similar Questions

  • How to check the previous value of the element in a multi-record block

    Oracle Version: 10 g
    Forms Version: 10 g

    Hi all
    Hello everyone, I have a multi-dossier block in a form where one of the values of elements is of LOV.user can select the value of LOV.

    If once the user selects the value of LOV and moves to the next of the multi-file record, and selects the value of LOV again, I shouldn't allow users to select the previous value of the user in order to avoid duplication of records.

    and important remark is that I should get there before you save it in the database because once registered in the database I can compare the values and hide the previous value.


    Any help will be appreciated.


    Thanks and greetings

    This is a question frequently asked in the forum! There are several different solutions. Take a look at the following articles. Both will perform the necessary verification of duplicates.
    Forms - registration of treatment group (value in double check...
    or
    Avoid records duplicated in a block

    If none of these solutions don't work for you, search the forum for other options.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • How to check the values in multi-record block. ?

    Hello

    I'm new to forms. I have the field titled "Comments" in the block of multi-record. I have a button called "reject". Reject button is in the control block. If I press the button reject, field comments must be entered in one of the record. Otherwise, he should tell message. How to check the multi-record block. ?

    Pl.Help.

    Thanks in advance.
    Mano

    Mano,

    Add NEXT_RECORD just before the END of the LOOP.

         GO_BLOCK('');
         FIRST_RECORD;
         LOOP
              IF NVL(:., ' ' ) = ' ' THEN
                   MESSAGE('');
                   RAISE FORMS_TRIGGER_FAILURE;
              END IF;
              EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
              NEXT_RECORD;
         END LOOP;
    

    Kind regards

    Manu.

    If my response or response from another person was helpful, please mark accordingly

  • What is the query block?

    Hi guys,.

    I searched a lot on the "query block" on google, but dosent find any satisfactory article that will explain basic concept to me.

    I would like to know about the parameter query block that we specified when using indicators of query optimization in oracle.


    How can they be used? where we can find them?


    any suggestions?


    Thanks and greetings
    VD

    Vkrant,
    You did exactly the same thing that is asked of me all the time. What is the purpose of this indication in a simple query that I have to show you all the time. The answer is nothing, makes complex things however. But but but, in a very complex query, where there is a cross reference of the sections of different query is required, this trick will be useful to give a name to the underlying query.
    >
    Select / * + dept_id full (@qb d) QB_NAME (qb)
    of db.dept d;

    can we say its just alias?
    >
    Yes, any. Give an official name to the query. In this query, Department table will be available with FTS.
    HTH
    Aman...

  • How to do the validation to the record level in multi record block.

    Hello
    I use form 10g. I have a doubt in form 10g. Look, I got multi-record block (10 records).
    In this block, I have a few items of text
    (1) S_NO
    Account_number 2)
    withdraw_amt 3)
    Deposit_amt 4)
    (5) balance_amt.

    These are the fields and sample data that I posted in forms.
    S. n ACC_No - WITHDRAW_AMT - DEPOSIT_AMT - BALANCE_AMT
    1-250 - 1000.00 - 1000.00
    2.------250-----------500.00-------------------------------------------500.00
    3-250 - 2000.00 - 2500.00


    Now, I entered the data manually in all areas...
    But what I need is if I entered the field of deposit in the amount it will add to the old balance and if I add the amount to remove the field that he removed from the old balance automatically.
    Pls tell me what are the possible ways to implement this form...


    Eliane.

    For the calculation of the fields there are some properties, you can define and then let the calculation forms. The WHEN-VALIDATE-POINT-approach will not work, because it increases your balance_amount whenever you change the value.

    But what exactly is the logic for your calculation. It's just: BALANCE_AMT =: DEPOSIT_AMT-: WITHDRAW_AMT?

    If so, create a new database item not in the block, assign Calcaulation-mode of 'Formula', a formula to something like

    NVL(:BLOCK.DEPOSIT_AMT,0)-NVL(:BLOCK.WITHDRAW_AMT)
    

    Then whenever you change DEPOSIT_AMT or WITHDRAW_AMT, the BALANCE_AMT will be calculated again.

  • ORA-01789: query block has an incorrect number of columns of results

    Hi guys,.

    I do the query like this:

    Select

    SPH. PERIOD,

    SPL. PERIODE_DETAIL,

    SUM (case when spl.) SUB_KRITERIA = "KEHADIRAN" then spl. NILAI

    end) AKTIFITAS_KEHADIRAN

    SUM (case when spl.) SUB_KRITERIA = "KONSISTENSI" then spl. NILAI

    end) AKTIFITAS_KONSISTENSI

    SUM (case when spl.) SUB_KRITERIA = "KERJASAMA" then spl. NILAI

    end) KOMUNIKASI_KERJASAMA

    SUM (case when spl.) SUB_KRITERIA = "KOORDINASI" then spl. NILAI

    end) KOMUNIKASI_KOORDINASI

    SUM (case when spl.) SUB_KRITERIA = "INTEGRITAS" then spl. NILAI

    end) LOYALITAS_INTEGRITAS

    SUM (case when spl.) SUB_KRITERIA = "KEJUJURAN" then spl. NILAI

    end) LOYALITAS_KEJUJURAN

    SUM (case when spl.) SUB_KRITERIA = "KEPATUHAN" then spl. NILAI

    end) LOYALITAS_KEPATUHAN

    of sci_pk2m_line@sucodev spl, sci_pk2m_header@sucodev sph

    where spl.ID_PK2M_HEADER = sph.ID_PK2M_HEADER

    and sph. UNIT_KERJA =: P314_ID_UNIT_KERJA

    and sph. = PERIOD: P314_PERIODE

    and sph. PERSON_ID =: P314_NPP

    Group

    SPH. PERIOD,

    SPL. PERIODE_DETAIL

    UNION ALL

    Select

    LON

    KETERANGAN,

    UNIT_KERJA,

    PERIOD,

    PERSON_ID,

    AKTIFITAS_KEHADIRAN,

    AKTIFITAS_KONSISTENSI,

    KOMUNIKASI_KERJASAMA,

    KOMUNIKASI_KOORDINASI,

    LOYALITAS_INTEGRITAS,

    LOYALITAS_KEJUJURAN,

    LOYALITAS_KEPATUHAN

    Of

    SCI_TOTAL_PK2M_V

    where = PERIOD: P314_PERIODE

    and PERSON_ID =: P314_NPP;

    When I compile and run the program there show the error like this "ORA-01789: block has an incorrect number of columns in query results.

    I don't know what does mean,.

    could you help me with my problem?

    Thank you

    Best regards

    Jeff

    Hi Linda

    You made the UNION between a statement select 9 columns to return with a second return 12 columns. Please unify the number of columns selected at a time.

    I hope that solves your problem

    Concerning

    Mahmoud

  • Browsing through the values of multi-donnees block against certain values BEFORE UPDATE! (FORMS 10G)

    I have a form with 2 blocks: a tabular and a single.

    I need to check a condition before INSERT/update to each record.

    To insert, I do this in WHEN_VALIDATE_RECORD and its working perfectly fine.

    However, to insert, as only the updated records are validated if its does not work very well against all records.

    How to browse and check all records against a condition on the UPDATE.

    I tried go_block, loop, depending on type of logical record in pre_update and pre_commit, but they are limited to these triggers.

    How to solve this problem?

    Kind regards

    Misbah.

    What I mean is that you must take logic out-pre - COMMIT because you can't do a GO_BLOCK.  Instead, you need to transfer this logic in triggering the COMMIT BUTTON.  It is not limited, so he can make the GO_BLOCK, NEXT_RECORD, etc...

  • To add values in a multi-record block in oracle forms 6i

    S. n

    Agenda

    Quantity

    1

    KEYBOARDS

    5

    2

    MOUSE

    6

    3

    MONITOR

    2

    4

    CENTRAL PROCESSING UNIT

    4

    TOTAL quantity

    17

    Hello world

    He is an example for adding records in this block. I need to add the values of the quantity of each time when it has updated. Entering the first record(value=5) the total should display 5. When you enter the second value(value=6) the total should be 11. And if it changes in accounts are rendered already entered the total value must be updated. Please help me do this in oracle forms.

    Hey, Moris,.

    For the contents according to your requirement, create a block and put an element contained in this block that reside on the same canvas.

    Then below mentioned property BLOCK for newly created block:

    • Single disc: Yes

    Then set below mentioned ELEMENT of property for the newly created item:

    • Data type: number
    • Method of calculation: 'summary '.
    • Text-to-speech function: "sum".
    • Block in summary: block that you created
    • Point summary: Point you have created

    I hope it will work for you, I tested and works great.

    Thank you

    Nilesh Goswami

  • How to get the original number multi-record block registration

    Hi all


    I know how to find the item duplicated in several record block.

    For Ex:
    Line_Num            Item_Name             Quantity
    1                           AA                      10
    2                           BB                      20
    3                           AA
    Here record 3rd nom_element is duplicated, I can able to check and display the message that "point is duplicated", I found [sheikyerbouti.developpez.com/duplicates/duplicates.htm].

    but I want to show as well as the original line to be number 1 when the nom_element came.

    Here I want to check the original Line_Num and display the message

    "Item is duplicated, update quantity in the original 1' line."

    Can someone help me find it?
    Thank you.

    Kind regards
    Guru.

    In the following key trigger write code like this I think it will help you

    declare
    v_Text varchar2 (20);
    NUMBER OF V_REC;
    BEGIN
    v_Text: =: test;
    V_REC: =: SYSTEM. CURSOR_RECORD;
    premier_enregistrement;
    loop
    If v_text =: test V_REC AND <> : SYSTEM. CURSOR_RECORD then
         
    GO_RECORD(:SYSTEM.) CURSOR_RECORD);
    RAISE FORM_TRIGGER_FAILURE;
    END IF;
    WHEN THE OUTPUT: SYSTEM. LAST_RECORD = "TRUE";
    NEXT_RECORD;
    END LOOP;
    GO_RECORD (V_REC); NEXT_RECORD;
    -v_Text: = NULL;
    EXCEPTION
    WHEN FORM_TRIGGER_FAILURE THEN
    RAISE FORM_TRIGGER_FAILURE;
    END;

  • Multi query RIDC sorting fields

    Hi Expert,

    I'm newbie Oracle COE. Please help me to share code RIDC on sorting multi areas.

    If 1 field will use it below.

    myRequestDataBinder.putLocal ("SortField", "dDate");
    myRequestDataBinder.putLocal ("SortOrder", "Desc");

    I thank you very much.

    Sirichai.S wrote:myRequestDataBinder.putLocal ("SortField", "dDate");

    myRequestDataBinder.putLocal ("SortOrder", "Desc"); >

    Remove the two variables above and use "SortSpec". For example

    myRequestDataBinder.putLocal ("SortSpec", "ORDER BY dDocType asc, desc dDocName");

    YMMV

  • Cannot access the multi-record block

    Hi friends

    I am facing a problem in one of 6i.

    On the form:
    In our form, we have two tabs:

    Tab1: We're looking for an order

    Tab2: Lists all commands

    Problem:
    When we have two tabs enabled, then I am able to move through the records of Tab2 (keyboard and mouse)

    However when Tab1 is disabled, so I am not able to navigate through the folders in Tab2 (keyboard or mouse)
    It has scrollbar in Tab2, when I drag the scroll bar, and then I am able to navigate through folders block2, but still not with the mouse.

    Limit of naviagtion of mouse is form
    For the block gives problem: elements have keyboard navigable Yes



    I do not understand this behavior, that is our requirement for some tab1 user will be disabled

    Hello

    u think to tab1 to user2 invisible so pending a TIMES-NEW-FORM, you can use to have...

    GO_BLOCK...
    GO_ITEM...
    

    I doubt that will help me with that: If the 2 trigger is executed after 1

    WHAT is the name of the trigger you want to know about his execution?

    I hope this helps...

    Kind regards

    Amatu Allah

  • Sum on multi block record for only displayed records

    Dear all,

    I've been invited below question on interview session and I really do not come upwards with a logic to accomplish.

    In a multi record block, not the displayed items property has the value 10. In this block, an element is placed named current_rate (Number data type).

    While the form is running, it will display 10 records, and I need to display the sum of the current_rate for these 10 records. When I scroll to display multiple records, this amount must also be changed based on the record number of display. Is it possible to make forms to operate this way?

    Please advice.

    Thank you and best regards,

    The roots.

    Another way - create element (e.g. "sum") in a block of control (for example, "cb") and write this:

    -Prior REQUEST for the block of data (for example "E1")

    : cb.sum: = 0;

    -After REQUEST for the block of data (for example "E1")

    : cb.sum: =: cb.sum +: emp1.salary;

    Query the property size array in a data block (specifies the maximum number of records Form Builder to retrieve from the database at the same time)

    must be 0 (default = the number of records can display the block, as indicated by the property of block number of records displayed).

    Concerning

  • check the entry of duplicate data in the block record multi, which is a required field

    Hi all
    I have a situation where I have to check duplicate data entry (on a domain, which is a field, i.e. mandatory. it cannot be ignored by the user without entering a value) in key-in data in a Multi Record block.

    With regard to the reference I used logic, such as
    1 > trigger in a when-validate-Record of this block I assign the value of the current element in the variable of type array (collection type)
    as this trigger every time I leave this record, so its by assigning the value of the current time. And this process continues

    then
    2 > wrote in a when-validate-item trigger of the corresponding element (i.e., the relaxation is at the element level), where he compares the value of the current item and the value stored in the variable of type table trigger when-validate-Record (type of collection). If the value of the current element is mapped to a value stored in the variable of type table I shows following message ("Duplicate Record") raise_form_trigger default


    This code works very well for the double value of this record multi field check

    The problem is that if the user enters the value of this field and then go to the next field, enter the value in this field, and then press 'Enter Query' icon, Validate bolt trigger fires. As a result first when - validate record fires, that stores this value, and then when-validate-point fire, so it shows message duplicate record


    Please give me a code or a logical sense to solve this problem



    Any other logic to solve this problem is also welcome

    If you query the data and it shows two unique values in the block, then it should work as expected. But if you don't ask and just open form and try to insert the record and then for the first record it does not display this message of duplication. For this, you can write your own query to check the duplication of table.

    For the image of the form, you can use any image download site. A search on google.

    -Clément

  • Hiding from the Multi control registers block - Runtime

    Dear all,

    We work on Forms 11 g. In our Application, we have Multi Record blocks, and we require to hide some controls of The Multi Record block at run time based on Some Conditions. But the problem is that, while hiding, some Gap will be there, and we must avoid that. What we can do for this?

    Thanks in advance,

    Vishnu.

    Dear Vishnu.,.

    If you want to hide the control, then take the width of the element, and add that to the width of the control, which is to the left of the element. The gap will be filled by the post office, whose width is increased, like, reduce the X_POS of the element, which resides in the right side, with the width of the masking element. Also, if there is a need, then increase the width of the moving element.

    I hope this helps.

    Manu.

  • activation and deactivation of the button in the block record multi

    Hi all
    I use
    Forms [32 bit] Version 6.0.8.24.1 (Production)
    Oracle Database 10g Release 10.2.0.1.0 - Production
    I have a multi record block each block contains a button (the button is to approve the record in terms of change of status)
    I have elements such as the date, remarks and button
    the button should be enabled if the remarks is not null in the case otherwise it should be disabled.
    I wrote to this effect in the pre-record trigger
    if :record is null then
       set_item_property('button',enabled,property_false);
    else
          set_item_property('button',enabled,property_false);
    end if;
    What problem is enable and disable has repercussions on all the buttons in the block. in other words, if the remarks of the first record is null then all records button is disabled. If the observations of the first record column is not null, then all the records in the column of buttons is enabled.
    I have to enable and disable the button for the corresponding record.that ways if the remarks of the first record column is not null not so only records first button should be activated and others should be disabled.

    Thank you...

    Hello

    but I'm not able to do.

    You can find the current record Y_POS 
    

    This means that whatever the user record navigates according to whether the button position gets her past set.but not.
    for example the user navigates up to the fourth record that will settle the position of the button but if user navigates back to the first record. the position of the button is going to the fifth record?

    V_ITEM_Y_POS: = GET_ITEM_PROPERTY ("NOM_ELEMENT", Y_POS);

    Please note that do not use the button element to get the Y_POS.
    This should be another element in the block, then button as a buttons position will continue to change on
    What you are to get the Y_POS of button which is the fourth position of the record for the first time so, it is fair,
    second time you set Y_POS button which is 4th record + first recording which is the fifth album,.
    you need to find is the Y_POS from a fixed point in the block.

    in your description what do you mean by top_record. Why I ask, is because it is multi record block(showing_10_records).so will appear every 10. no record may be hiding.

    Top of page record is the first record in the block.
    For example, in a record 10 block, if there are 20 records then if you navigate the records, if you go to the 11th, 12th, 13th, 14th... the other then your TOP_RECORD be record No 2, 3, 4,... is the first record that is displayed in the block that is not always 1, and will be 1 only for the first 10 rcords.
    If we use: system.cursor_record we will not be able to get the Y_POS exact numbers of superior record then 10 which will put the button located under the last (10th) record, which is not what we want, so need to find the TOP_RECORD.

    Best regards

    Arif Khadas

Maybe you are looking for

  • Updated BIOS for S3000 - X 4 (V1.6)

    I have problems to upgrade the BIOS through Windows.Graphics need to be upgraded at the same time, but can do it everything first?I tried upgrading the BIOS first but get an error message"Phoenix Phlash errorOpen file failed on Platform.binPress a ke

  • partial and total indicator with meter

    Hello guys,. I put an application implemented using counters timers. I created a Vi that read a meter of a water sensor (each litre give me an impulse), and I take this opportunity to analyse use partial and total water in the laboratory. I want to c

  • I can't find a way to turn off Microsoft Narrator. I do not need/want it. It is so boring.

    Somehow the system Microsoft Narrator has had on my computer, and even if I do have a knowledge of computers, I find anywhere the method to disable this add.

  • Site to Site with NATing

    Hi all I'm kind new to Cisco and I have no expertise CLI. I need to configure a VPN site-to site (IPsec tunnel) with NATing. I have already installed several L2L no need with ASDM without problem, NATing.  Here's the scenario: Site1 use 192.168.1.0/2

  • T500 warranty questions

    I just bought my son, who is leaving for college in a week, a soft T500 (2055) the decision-making of Lenovo. It's a machine 'new' as defined by the decision, which means that it was never delivered to a customer. (1) according to the status page of