Distinct on a Forms' Block

Hi all,
I'm looking for an advice for the following problem:
I have to display two separate blocks: the first one is base table block(let's say CODE,DESCIPTION,QUANTITY with insert/delete/update functions) and another one (just to display data) with CODE,NR. The second block would correspond exactly to this statement: "SELECT CODE,COUNT(*) FROM first_block GROUP BY CODE;" (referencing the block cause I want to monitor what's going on the block and not on the db table).
Of course the issue is that I can't execute such a select, so I'm asking for an advice regarding some Forms' block/application property I'm not aware of and which can be useful for this task.
Any help will be very appreciated, thanks.
Marco

Hi Marco,
I'm not quite sure what you are trying to do as you don't say what the connection is between the first and second block.
Are you just trying to
1) display the number of records that forms could have retrieved in the first block based on the query criteria
2)trying to show a count of all records where block1.code = block2.code
3)Trying to show a count for all codes regardless of what records are in the first block
If 1 then create a non-base table item and populate it with the built in count_query
If 2 then create a non-base table item and populate it with a procedure to do a "select count(*) from table where :block1.code = table.code"
If 3 then create a view as "select code, count(*) from table" and then create a block on this view - if required you can then retrist this block to values in block1.
Hope this help (there nay wel be other better ways...)
Keith

Similar Messages

  • Select statment & form block

    Hi,
    I have one issue here which is:
    Oracle 10g
    Suppose you have a select stament which contain
    A lot of columns can i reflect this statment in form
    Block and apply delete update insert action in this block
    Regards,
    Edited by: kingadmin on Aug 19, 2012 10:31 PM

    Is this a onetime task? If so, i would
    -create a database view
    -create an INSTEAD-OF-trigger on the view
    -base your block on the view.
    It might be that you have to change the key-mode of the block to maybe "Non-Updateable" and that you have to create your own ON-LOCk-trigger.m(Depends on the complexity of the view)

  • Calling Form/Block from another Form/Block

    I have several form/blocks in my application with field COMPANY_NAME/ID. How can I navigate from more then 1 form/block to the same Form (with Company information)
    From 1 Block it is easy: Where clause: :t_bedrijf_lijst.bedr_id = t_bedrijf.bedr_id
    But now :t_bedrijf_lijst. is depending from the previous form or block
    can anyone help me with this?

    Hi Slot
    Make a package like this in any PL/Sql Library which is attached to your forms:
    PACKAGE GLOBAL_VAR IS
    v_company_name varchar2(15);
    v_company_id     varchar2(10);
    END;
    and whichever form you want to refer it you can refer this way:
    MESSAGE(GLOBAL_VAR.v_company_name);
    MESSAGE(GLOBAL_VAR.v_company_ID);
    hth
    ARIF

  • Report  from  Forms block records

    I have a temp table data block in forms displaying n number of records using many procedure and calculation.
    This records are not committing only for the display purpose. when ever user press execute button , it performs some calculation and insert record in the table block.but not commiting. now i want to give a print button and run a report using the records existing in the form data block. how will i achieve this.

    Hi,
    i want to commit only print tableOK, so this is an issue about how you write your PL/SQL (or SQL) code. I can only advise this:
    1. Insert records into the print table
    2. Issue commit
    3. Insert records into other tables
    However, I think people from the SQL, PL/SQL teams may have some more ideas for you. This is the forum where they answer Q's:
    PL/SQL
    Navneet.

  • Can i create a report based on a Forms Block

    Dear All i am using Forms reports 10G.
    I have a form in which i have 2 block . One is header and another is details .
    In header i have 4 non database text items and the detail one is a tabular form and it is based on a table .
    I have a PRINt button in the details block .
    I want when user will print button then it should print what is there in the form.
    Like :-
    In header i have data like ABC and USA .
    And in details i have many records like this
    23 , dddddddddddddddd
    and like this .....
    print should come like this :-
    ABC
    USA
    23-ddddddddddd
    24-lllllllllllllllllllllllllllllllllllll
    25-ooooooooooo
    So how can i read from the blocks and show in the reports?

    You should use the Report Builder it self, and then call the report through a button in the Form
    Use the Data Model to retrieve the data that you want:
    Retrieve firstly the Master query and then the Detail query and make a link between them, after that use the layout model to show the data in the report as you want
    I wish I could help you
    Regards

  • How to handle Scrollbar's event in the Form Block !

    I want to create three Block like
    Block : X-axis , Source From View
    Block : Y-axis , Source From View
    Block : Cell , Source From Stored Procedure.
    The relation is (X-axis , Cell) , (Y-axis ,Cell).
    Then , if i scroll X-axis or Y-axis Scrollbar , then Cell will change !
    Problem : If X-axis Cursor record does not change , the Cell's Data will not refresh.
    Can tell me how to handle the scrollbar's event , Thank.

    Thank you.
    The Cell's behavior is a matrix , the relation will execute when X,Y record is changed !
    if you move the scrollbar , will chanage block's data , but the cursor record does not change another!.
    If i use JaveBean to handle it , possible ?
    Using Form 6i .

  • Form Block Invisible at runtime

    Hi All,
    I have a problem.
    i have changed the field length to 200 to 240 .And it is the valid length i have checked with the database table length.
    But the strange thing is the block is not visible when i deployed into oracle application
    RDBMS : 10.2.0.3.0
    Oracle Applications : 11.5.10.2
    Can any one help me.
    thanks

    I have a problem.
    i have changed the field length to 200 to 240 .And it is the valid length i have checked with the database table length.
    But the strange thing is the block is not visible when i deployed into oracle application
    RDBMS : 10.2.0.3.0
    Oracle Applications : 11.5.10.2
    Can any one help me.Is this a seeded form or custom one?
    Did you use TEMPLATE.fmb?
    Was the form compiled successfully on the server? -- How do I Generate Forms in R11i or R12? [ID 742617.1]
    Thanks,
    Hussein

  • Online Interactive Form - Blocks Web Page

    SAP BASIS LEVEL: 15
    (ADS)  connection test: 800.20080218110307.448744
    Adobe Reader 8.1.2
    last sap note implemented: 1092088 (to enable pdf editing)
    test: FP_TEST_IA_01 - works properly!
    SCENARIO:
    ABAP web dynpro with UIelement for interactive form display and editing.
    1- 1st Web dynpro view with IForm element, (enable option = True) so user can edit the IForm.
    2- Data node for Binding has 0-n cardinality (so in IForm a dynamic table will be generated)
    3-  2nd Web Dynpro View, UI FileUpload for Iform Upload.
    PROBLEMS:
    1 - On Upload view, I tried the the Auto-Binding combining FileUpload and UI IForm element (as sap note)  but dosen't work. For now I solved the problem the old way, converted the xml from bin to string, parsed the XML and then did backward-data-binding.
    2- On PDF display view, the pdf is displayed correctly and it's editable, but any other actions user tries to do on the web page don't work.
      2.1 I have a (navigate back) button on the web dynpro, but  once the pdf is displyed, no interaction with the web page is possible.
      2.2 Context binding between WD and IF, not working properly, seems to add empty elements in the data node. (if in WD context i have N elements - IN IF Data Herarchy I have N + M elements, M = empty elements)
    NOTE: when enable option = FALSE, everything works ok, but Form is no more editable.
    Help needed....

    One more thing:
    If I put the view that contains the Iform in a popup window, I get this error when I try to close the popup, or any action on the popup window:
    Short text
        The ASSERT condition was violated.
    What happened?
        In the running application program, the ASSERT statement recog
        situation that should not have occurred.
        The runtime error was triggered for one of these reasons:
        - For the checkpoint group specified with the ASSERT statement
          activation mode is set to "abort".
        - Via a system variant, the activation mode is globally set to
          for checkpoint groups in this system.
        - The activation mode is set to "abort" on program level.
        - The ASSERT statement is not assigned to any checkpoint group
    method create_by_view_element.
      data:
        class_registry_entry type t_class_registry,
        mappings             type standard table of wdr_elem_ap
        mapping              type wdr_elem_apt_map,
        elem_defs            type sorted table of wdy_ui_elem_d
        elem_def             type wdy_ui_elem_def,
        new_entries          type standard table of t_class_reg
        adapters             type sorted table of wdr_uiel_adap
        adapter_def          like line of adapters,
        id_gen_entity        type string.
      if view_element is not bound.
    ==>    assert 1 = 2.
      endif.
      read table m_class_registry into class_registry_entry
           with table key view_element_cid = view_element->_cid

  • In Oracle Forms What is the difference between the Regions and Blocks ?

    Hi,
    In Oracle Forms What is the difference between the Regions and Blocks ?
    thanks
    siva

    Hi Siva
    in oracle forms Block are entities which represent your data (table, views etc), you can say like EOs and VOs.
    Well I dont know about regions in forms.

  • Enforce 'DISTINCT' clause in a db block....(solved)

    Hi ,
    Is it possible to set "distinct" in a db block....either in property palette or programmatically ..in PRE-QUERY , for example in Dev10g...????
    Thanks ...
    Simon

    You can set distinct in the query or procedure if query data source type you are using is from clause or procedure. Don't know other ways

  • What is equal to Forms control blocks in Jdev

    I need to create users in db and manage their passwords. In forms there are control blocks and there is available libraries to make the "create user" and "alter" statments usable.
    In jdev 9ias beta I am not seeing how it would be implemented. Bc4j and forms blocks are kind of similar. What am I missing? All suggestions are appreciated.
    Thanks

    Hi,
    Try to use <af:resetActionListener>
    <af:commandButton>
    <af:resetActionListener/>
    </af:commandButton>

  • How to populate records in forms

    hello all,
    i m making project named library management in forms and sql,
    i have a table names subject in which there are two fields subject and book_title
    in forms both item are as TList now i want to do is when we select particular subject example maths..all the related books of that subject populate with it in the title_book column.how can i do this
    please help me
    thanx in advance

    thanx
    but can u tell me how to change the filter of the form block
    regards
    ruchi

  • Forms is not cooperating at all!!

    ok so idk maybe I'm just not intelligent enough to understand Forms but I have read through various Documentation on Forms 11g and done research on it and I have typed stuff exactly how I read about to put it and nothing seems to be working like it is supposed to.
    I am working on making a page that can upload and download a PDF from the client's computer to the Database and back by use of buttons. The upload page has a browse button that is supposed to bring up an open dialog box using webutil and then when the user selects a file the file path of that file will be placed into a text box so that 1. they can verify that it is correct and 2. to store the file path for later. Then the user clicks the upload button and the button is supposed to pull the file path from the text item and store the file located in that location into the database.
    here is the code for each of the buttons.
    browse button:
    DECLARE
         File_Path VARCHAR2(255);
    BEGIN
         FILE_PATH := WEBUTIL_FILE.FILE_OPEN_DIALOG
              C,
              null,
              '*.pdf'
         :block.file_upload_text := FILE_PATH;
         Synchronize;
         END;
    upload button:
    Declare
         Result_Upload BOOLEAN;
    Begin
         Result_Upload := Webutil_File_Transfer.Client_To_DB
              :block.file_upload_text,
              'file_tbl',
              'file'
    End;
    and the text box is in the data blocks drop down under buttons it was put there automatically by Forms. But when I try to compile it I get an Error 49 bad bind variable 'block.file_upload_text'
    the text item name is spelled correctly and everything I have found online says that is how to access the text in a text item I dont understand what is gong on that it isnt working and I am really getting annoyed at Forms because no matter how much I read about it and how much of the little of what is available that I look at I can not figure out what is wrong.
    Another problem I am having is that before you even get to this upload page there is another page and that page has a button that is supposed to pull up the upload page and I have figured out enough to figure out that I need the upload page canvas to be a data block in order to call it and then you use a go_block or something like that to pull it up but what I can't figure out is how to make that canvas into a data block... everything that I am finding is saying that to create a data block you need to call a table and stuff and I dont know how I am supposed to put that canvas into a table in the database so that I can create a data block with that canvas in it. I even found something that is supposed to walk you through how to do it and I got to like step 4 of 6 and it said to do something to do with double clicking the database node button or something and I looked everywhere and didn't find anything that said anything about database node. I have been working on this for about a month and a half now and it feels like I have gotten nowhere on it I still haven't even gotten to the download part at all.
    I got this same program working completely upload and download in Java in 2 weeks then found out we needed it to work with Forms so I found out I needed it to be a java bean not just java so I tried to figure that out, couldn't seem to figure out how a java bean worked with what I was trying to do and the only documentation I was able to find that might have been helpful for it was on a blog which are blocked from my work computer and I was informed that Forms had something built in that did exactly what I needed, well that hasn't helped much either so far... I could really use some detailed absolutely as dumbed down as possible help here because I really need to get this thing done.
    I know I rambled a little and I am sorry, any help that can be provided will be greatly appreciated!!

    Sorry for feeling uncomfortable with Forms. But your, I think there is a lot of room fpr (re-)reading forms documentation and other educational handouts.
    I won't solve yout problems, but may be I can give you few hints, tht came into my mind, when browsing yout post:
    DECLARE
    File_Path VARCHAR2(255);
    BEGIN
    FILE_PATH := WEBUTIL_FILE.FILE_OPEN_DIALOG( C, null, '*.pdf')
    +:block.file_upload_text := FILE_PATH;+
    Synchronize;
    END;
    1. What is C? You should get a compilation error since iot is nor declared.
    2. Do you need a directory ot a file. If the first take FILE_SELECTION_DIALOG into consideration. Or may ist easier for you to use CLIENT_GET_FILE_NAME. For this function don't miss to set FILE_SELECT-Parameter to FALSE.
    3. Are you sure the block, where the item FILE_UPDLOAD_TEXT is in is named BLOCK. Forms automatic naming will generate something like BLOCKn (where n is a number). But may be you have renamed the Block (what is common use).
    4. Declaration of file_path is not really necessary; you may assigne the result of the Function immediately to your forms item (via bind variable :<block_name>.<item_name>)
    5. Synchronize is not neccessary at this point, just costs a round-trip ofr the AS.
    (6. I'm an fan of PL/SQLs named parameter syntax; it make code easier to read and to maintaine. So your function call would read
    WEBUTIL_FILE.FILE_OPEN_DIALOG( directory_name => c, file_name => NULL, ...
    just a suggestion, fell free to uswr or not)
    The following is hard to understand. Probably you have a complete different understandind of how to program. You have to accept it's oracle forms an not sonething. That means there are certain structures:
    1. Data
    1 Form consits of one or several blocks; some of them may be connect to the database, often to a table, but it need not be a table; these are called database blocks, others (no database connect) are often called control block (but might also hold data).
    1 Block consists of one or several items; some of them hold data in form of text, numbers, date, image, lists, radios ...; others are means to control the application, e.g. buttons.
    2. View
    1 Form consists of one or several windows.
    1 Window contains one or more canvases; at least one content canvas; there are also other types, but I think you don't need them.
    On the the canvases you "paint" all the things you want to sho to your users, your items (you have to make an item visible and assigne a canvas in the canvas property), free text, graphic elements.
    You don't program a "page"! Your application is running within an applet within a page.
    3. Logic
    You may assigne logic via triggers to the elements of the data stack (form, block, item), not the view stack.
    You may put logic into procedures and functions for better readability and maintainance; these can be stored locally in the form or in own libraries for re-use in other forms.
    What trigger to use in which situation? That beyond my post.
    A special topic here: you can extend forms functionality with java beans. You have to extend forms functionalty with java beans, if you need to get our of the applet sand box. You need that because you want to read/write information of your local client. Basic Java beans you find in WEBUTIL. It offers, I am sure, all the functionality you need. And you have found them.
    So to get your problem solved of showing the whole stuff after pressing a button there a several possibilities:
    easiest: create 2nd content canvas and put your items there; at the switching button issue GO_BLOCK('<block_name>') OR GO_ITEM('<block_name>.<item_name>'), where block_name is that thing that makes the compilation trouble.
    bit mor an effort: create an own window with a new content canvas; the rest as described above; get some knowledge about SET_WINDOW_PROPERTY, espacially in cinjunction with the property VISIBLE, you will need it, whenn switching back;
    even more effort: create an new forms + .... and call this form on the swithing button.
    This might be a reasonable way if you want to re-use this function (up-/down-loading) from several forms.
    Last sentence, in java it took 2 weeks?in forms, Iwould say it's a task for 2-4 hours (forms and webutil correctly installed nd configured). But I won't tell your boss.

  • How can I store a form name with path and then call form from a table

    Is it possible that any form that I built I store that form in some table in DB and then call that form from table, if yes, then how can i get this functionality. I am not very experience in form and do not know if it can be done because i think if it is possible then this can be a good security for application and easy to handle as well.
    Thanks in advance
    Maz

    If you have a Forms block based on this table:
    declare
      module varchar2(100);
    begin
      module := :block.column;
      call_form ( module ) ;
    end;If you don't have any blok based on that table
    declare
      module varchar2(100);
    begin
      select  module_name
      into module
      from ...
      where ...
      call_form ( module ) ;
    end;Francois

  • Multiple DataBase Connection in a Single Form

    hi all
    Is it Possible to have Multiple Database Connection With a Single Form
    Block a : Retriving data from a database Service a/Schema A.
    Block b : Retriving data from a Remote Database Service b / Schema B.
    If yes how to do this.
    regards
    jai
    email:[email protected]

    Sure you can access a database this way,
    but can you base a block on this database connect? No you can't.
    Frank

Maybe you are looking for