Group by on data block

Hi all
sorry for troubling u frequently actually i am in a firefighting mode and the deadline of the forms is by weekend and i am relatively new to forms
i have a summary block on which i want to use a where clause where there is a group by
the summary data block consists of 4 columns
order_number,part_number,status,quantity
i want to display the records based on the sum(quantity)
basically
select order_number,part_number,status,sum(quantity)
from summary
where order_number = order number from the control block form
and part number =part number from the control block form
and status = status from the control block form
group by order_number,part_number,status
is it possible to write my where clause as
where order_number = order number from the control block form
and part number =part number from the control block form
and status = status from the control block form
group by order_number,part_number,status
and if yes where do i specify the sum(quantity)
please help me
thanks a lot for your help you are providing me
thanks
satish

Hi
if yes where do i specify the sum(quantity)in any display item on the ctl block.
SELECT order_number , part_number , status , sum(quantity)
INTO  : order_number  , : part_number  , : status  , :quantity
from summary
WHERE order_number = :cotrol_block.order number
and part number = :cotrol_block.part number
and status = :cotrol_block.status
GROUP BY order_number,part_number,statusHope this help...
Regards,
Abdetu...

Similar Messages

  • Inserting multiple records in a data block

    Hi, how do i insert multiple rows from a record group into a data block. Thanks

    You do it manually. Copy the values and move to the next record in the record group and in the block.
    You might like the concept of basing a block on a stored procedure better. Check out the stored procedure based block sample that comes with the Oracle Forms demos.

  • Multiple Selection from a data block

    Hello,
    I have a data block returning the names and surnames of employees. Can I select multiple rows from that data block?
    Thank you

    You could put a checkbox on the row and if it is ticked then interpret this as a selected row.
    Sometimes it is useful to store this type of selection in some type of structure like a record group or index by table and process those rows rather than read the data block

  • Creating "Control Combo Box " Relation with data block

    Hi all dears
    i am switching from C# to oracle developer for joining gulf net software house, i have a problem regarding master detail data
    the senerio is
    "List items" control Filled programatically as under shortly:-
    rg_id := create_group_from_query('myrg', 'select dname a, dname b from dept');
    populate_group(rg_id);
    populate_list('mylist', rg_id);
    using this i fill my combo box during new form instance trigger
    i have created a datablock emp through wizard which can show 10 record.
    now
    Problem 1
    i want to show records on form when user select any dept from combo box.
    Problem 2
    if i create group from query and in select statement is like this "select dname, dpetno from dept" the record group is created successfully but i am unable to populate_list due to different data type colums in record group how i will populate list so that List items Labels are department name and value is department no
    Thanks in advance for persual

    Hi dears all
    I have solved this problem my self
    1. select dept name form combo box and the data block shows the emp's of concern depat
    solution
    create a data block of emp table through wizard
    create its table view and show 10 records
    go to datablock i consider its name "emp" datablock properties
    in Where clause condition specify deptno = : my_combo_box;
    now go to combo box when item changed event
    go_bolck("emp);
    execute_query;

  • Hyp 9.3 FR CellText - Suppress data blocks that don't contain Cell text

    I'm creating a Financial Report that focuses on Data Blocks that contain Cell Text. The following function works when retreiving at a level one or higher Member for retrieving data.
    *<<CellText("Grid1", cur, A, 1)>>*
    The results of the function return the following:
    0093 663020 Jan 1,000 This is a Test Too.
    0093 663020 Jun 15,000 This is a Test for Brenda
    0093 663030 Feb 2,000 Try this one on for size.
    0093 663030 May 20,000
    Note the last line does not contain a Cell Text. This is due to the test group of data blocks has four populated data blocks and only three of the data blocks have cell text attached.
    I would like to be able to filter the last data block that does not contain the cell text in order to increase the member levels in the various dimensions+
    Any Suggestions?+

    Try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home/Library/ Preferences folder. You may have to use your Admin password in order to move it.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
    User/Home/Library/Caches/com.apple.iPhoto folder (Snow Leopard and Earlier).
    or with Mt. Lion from the User/Library/Containers/com.apple.iPhoto/
    Data/Library/Caches/com.apple.iPhoto folder
    3 - launch iPhoto and try again.
    NOTE 1: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    NOTE 2:  In Lion and Mountain Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    OT

  • Data Blocks Based on Stored Procedures

    Is it possible to to create a data block based on a stored procedure, and create a dynamic list as a drop down box?
    I have a form that runs successfully that has a data block based on a stored procedure. I add my trigger to create and populate the record group. Then in the Property Palette, when I change ITEM TYPE from TEXT ITEM to LIST ITEM, I receive the following runtime error:
    FRM-40350: Query caused no records to be retrived.
    Note: the tlist/list item runs successfully on a data block based on a table.

    1) go to the block property to remove the same item column, then re-add the item; Since the property may remember the old text type;
    make sure the record value for the list tiem from stored procedure is among the list elements!
    Last sort is to do:
    2) you may re-create your gui based on the table by setting the list type this time, then set the block property to be based on the stored procedure.

  • Upload data from microsoft access to oracle form(in data block)

    Hi all,
    Any one can help me, how we can upload data from access file to developer form(in data block).
    as
    we upload data from text file to developer form(in data block) using some packages.
    Thank's in advance

    Hi Zuhair,
    If you give details of the problems you are still having then we should be able to get SQL*Developer to work.
    However, if you don't want to use SQL*Developer then the following options are taken from note 393760.1 available in Metalink if you have access to that -
    1. Use a gateway that supports the non-Oracle database or generic connectivity if a third party ODBC driver is available to do a -
    'create Oracle_table as select from non_oracle_table@database_link'
    for each table. You would then have to manually create all the other objects (views, indexes, stored procedurs etc) and permissions etc that existed in the non-Oracle database.
    2. Use the SQL*Plus COPY command to copy data from the non-Oracle database to the
    Oracle database using a gateway or generic connectivity. The syntax is as follows:
    COPY FROM username/password@oracle_sid -
    INSERT destination_oracle_table -
    USING query;
    The following example selects all rows from the EMP table in the non-Oracle database and
    inserts them into the local Oracle EMP table:
    COPY FROM SCOTT/TIGER@ora10 -
    INSERT EMP -
    USING SELECT * FROM SCOTT.EMP@gateway;
    where "gateway" is the database link created for the gateway.
    3. Load the non-Oracle data into flat files and use SQL*Loader to put the data into Oracle tables. Again manual
    work is required for the other objects.
    4. Contact the Oracle Product Technology Services (PTS) group for assistance. See the webpage -
    http://www.oracle.com/technology/tech/migration//workbench/index_sqldev_omwb.html
    5. Use a third party migration tool. See -
    http://www.oracle.com/technology/tech/migration/isv/third_party.html
    6. Use JDBC to connect to the non-Oracle database and Java in the Oracle database. This method will work but it is not suppported by the JDBC team.
    =========
    The amount of work involved will depend on the number and size of Access tables that you want to migrate.
    Regards,
    Mike

  • Form blows up when clicked in data block using a FROM clause query

    Hi,
    I have a form that has two blocks. The detail block is based on a "FROM query clause" in the 'Query Data Source Type' in the block Properties.
    I have a simple select in the 'Query Data Source Name'.
    I made sure the select is enclosed in parenthesis and the alias names in the SELECT are the same as the ITEMS defined in the block
    The data needs to be displayed in a tabular fashion.
    When I run the form, the data is displayed correctly..but when I click the mouse on any item of this block or try to scroll down, everything just blows up and it closes my form.
    I have made sure both blocks have the same properties. But, this seems to happen no matter what.
    Any help in regard is greatly appreciated.
    Thanks much,
    Vijji

    This is how I set the relationship for the detail block say BLOCK2.
    1. I first do this:
    Database Data Block = YES
    Query Allowed = YES
    Query Data Source Type = FROM clause query Query Data Source Name = ( select jio.order_header_id order_header_id, jii.item_code item_code, SUM(jii.item_qty) item_qty from joe_indv_items jii, joe_indv_orders jio where jii.indv_order_id = jio.indv_order_id group by jio.order_header_id, jii.item_code )
    The master and detail need to be tied by the order_header_id which I can get from the header block.
    2. In the WHEN-NEW_BLOCK-INSTANCE trigger for BLOCK2, I wrote the following where I dynamically pass the order_header_id:
    DECLARE
    q varchar2(1000);
    BEGIN
         q := '(SELECT jio.order_header_id order_header_id,
         jii.item_code item_code,
         SUM(jii.item_qty) item_qty
         FROM joe_indv_items jii, joe_indv_orders jio
         WHERE jio.order_header_id = ' || :HEADERS.order_header_id||'
         AND jii.indv_order_id = jio.indv_order_id
         GROUP BY jio.order_header_id, jii.item_code )';
         CLEAR_BLOCK;
    SET_BLOCK_PROPERTY('BLOCK1', QUERY_DATA_SOURCE_NAME, q);
    EXECUTE_QUERY;
    END;
    I am not sure if I should write the exact select statement in the Query Data Source Name or not.
    Please advice.
    Thanks much,
    Vijji

  • How to find a value into a data block

    There is a way to find a value into a data block, like finding
    one into a record group
    null

    Rafael Moreno (guest) wrote:
    : There is a way to find a value into a data block, like finding
    : one into a record group
    Try something like this:
    -- has to be in a when-button-pressed or key trigger
    go_block('x_block');
    first_record;
    r_found:=false;
    loop
    if :x_block.search_field:=search_value then
    r_found:=true;
    exit;
    end if;
    down;
    end loop;
    if r_found=false then
    first_record;
    message('Value '

  • Data blocks in forms 6i, can not see the data

    i have built an application in forms with some data blocks. the blocks a connect to some tables in the db. i have built them connectd as "system". but when i run the applicatio as user x i can do select, insert, update, delete, but i can not se the records in the datablocks (they are empty), but i can do all transactios. why?

    First of all, developing from the System schema is not a good idea.
    Who owns the tables your form is connecting to? The table owner should create a public synonym for each table name, and also needs to grant user x access to the table.

  • Sum of LineCount Including Groups and Detail Data On Each Page Used To Generate New Page If TotalPageLineCount 28

    Post Author: tadj188#
    CA Forum: Formula
    Needed: Sum of LineCount Including Groups and Detail Data On Each Page Used To Generate New Page If TotalPageLineCount > 28
    Background:
    1) Report SQL is created with unions to have detail lines continue on a page, until it reaches page footer or report footer, rather than using  subreports.    A subreport report is now essentially a group1a, group1b, etc. (containing column headers and other data within the the report    with their respective detail lines).  I had multiple subreports and each subreport became one union.
    Created and tested, already:
    1) I have calculated @TotalLineForEachOfTheSameGroup, now I need to sum of the individual same group totals to get the total line count on a page.
    Issue:
    1) I need this to create break on a certain line before, it dribbles in to a pre-printed area.
    Other Ideas Appreciated:
    1) Groups/detail lines break inconveniently(dribble) into the pre-printed area, looking for alternatives for above situation.
    Thank you.
    Tadj

    export all image of each page try like this
    var myDoc = app.activeDocument;
    var myFolder = myDoc.filePath;
    var myImage = myDoc.allGraphics;
    for (var i=0; myImage.length>i; i++){
        app.select(myImage[i]);
        var MyImageNmae  = myImage[i].itemLink.name;
        app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.high;
        app.jpegExportPreferences.exportResolution = 300;
           app.selection[0].exportFile(ExportFormat.JPG, File(myFolder+"/"+MyImageNmae+".JPEG"), false);
        alert(myImage[i].itemLink.name)

  • I can not put the data of a field(LONG RAW) consulted into a item of a data block

    I want to query a field that is LONG RAW(it's a image) and put the data into a item of a data block (in Forms Builder), when i write ":BLOCK.FOTO:=vfoto" i recieve this errors: "bad bind variable ....". How can i put the data of field of my DB and put the data in a item of a data block(in Forms Builder)?.
    I can store a image in a table of my DB, but i want to query a image stored in my DB and put it into anothers table, all this on FORMS BUILDER.

    You have to base the image item on a base table and use EXECUTE_QUERY on that block. You can't do a direct select in PL/SQL into the item

  • Insert and update a data block which is based on view--urgent help required

    Hi experts,
    I created a view(A_VIEW) which is based on a union select. I have created a data block A_VIW_BLOCK which is based on this view. I need to insert/update one of the base tablesfor A_VIEW through this data block. I also need to be able to make a query through all the fields in the view.
    The questions are:
    1.Can it be done at all?
    2. What properties need to be set?
    3. If can't be done, what the best approach to achieve this?
    Thanks in advance!!
    Michael

    hi
    try something like this.
    CREATE TABLE demo_tab (
    person_id NUMBER(3),
    first_name VARCHAR2(20),
    last_name VARCHAR2(20));
    CREATE OR REPLACE VIEW upd_view AS
    SELECT * FROM demo_tab;
    INSERT INTO demo_tab
    (person_id, first_name, last_name)
    VALUES
    (1, 'Daniel', 'Morgan');
    INSERT INTO demo_tab
    (person_id, first_name, last_name)
    VALUES
    (2, 'Helen', 'Lofstrom');
    COMMIT;
    SELECT * FROM upd_view;
    UPDATE upd_view
    SET person_id = person_id * 10;
    SELECT * FROM upd_view;
    desc user_updatable_columns
    SELECT table_name, column_name, updatable, insertable, deletable
    FROM user_updatable_columns
    WHERE table_name IN (
       SELECT view_name
       FROM user_views);
    SQL> create table dummy (f1 number);
    Table created.
    SQL> create view dummy_v 
    2  as 
    3  select f1 from dummy 
    4  union all  
    5  select f1 from dummy;
    View created.
    SQL> create trigger dummy_v_it 
    2  instead of insert 
    3  on dummy_v 
    4  for each row 
    5  begin 
    6    insert into dummy values (:NEW.f1); 
    7  end; 
    8  /
    Trigger created.
    SQL> insert into dummy_v values (1);
    1 row created.
    SQL> select * from dummy_v;       
    F1
    1        
    1
    SQL> select *
      2  from user_updatable_columns
      3  where table_name = 'DUMMY_V';
    OWNER    TABLE_NAME   COLUMN_NAME  UPD INS DEL
    FORBESC  DUMMY_V      F1            NO  NO  NOforms settings.
    Enforce Primary Key - No
    Query Allowed - Yes
    Query datasource Name - V_TSFDETAIL
    Insert Allowed - Yes
    Update Allowed - Yes
    Delete Allowed - Yes
    Locking Mode - Automatic
    Key Mode - Automatic
    do not forget to create synonyms.
    hope this helps.
    sarah

  • Multiple data blocks on the same canvas

    Forms newbie question:
    Is it possible to have 2 data blocks with two different sets of transactional triggers (ON-UPDATE, ON-LOCK, etc.) on the same canvas?
    I've got an example where i've got two data blocks (one sourced from a view, and one that is a CTL block) on the same canvas. The block sourced from the view is working fine. When I make updates, they are reflected, etc. But, i've got one field in the control block that I need to update from as well, and I can't seem to get it (or any of the CTL block items) to show up as "updateable", regardless of the set_item_property....theyre always grayed out.
    Do i need to take the user to a new canvas to be able to utilize the update of the ctl field?

    A second canvas is not needed. Normally, control-block items are always updateable, so there is something going on in your form to prevent it.
    > I can't seem to get it (or any of the CTL block items) to show up as "updateable",
    regardless of the set_item_property....theyre always grayed out.
    What... Is there code someplace in the form that sets them to Enabled, false? If that is the case, then to get them working again, besides setting Enabled to true, you also must set Updateable and Navigable to Property_True. (This is documented at the end of the on-line help on Set_Item_Property.)

  • Oracle Forms - How can I create a Data Block with query

    Dear friends I have a question, I couldn't do this..
    I have a sql query, I want to show the datas of the query.. How can I do this. ?
    Data Block Wizard wants a table, view or stored procedure, but I have a query, how can I create a data block with my query.. I m waiting your helps..? Please...
    Semih

    Hi,
    You have two options
    1. create a view and base the block on the view
    2. create a block with a query Data Source Type of 'FROM clause query'
    Hope this helps
    Neil

Maybe you are looking for