Sort multiple record block

Hi,
i want to sort a multiple record block by pressing a key on a non updatable field in the block.
Example:
i have a list of adresses in the block. Now i want to jump to all Adresses which starts with B.
Does anybody know a solution ?
Thanks in advance. MM

No problem:
When your records are ordered by the name (using block's order-by-clause),
use a procedure like the following:
procedure find_name(p_letter in varchar2) is
begin
  go_block('BLOCK');
  loop
    exit when :system.last_record = 'TRUE' or :block.name >= p_letter;
    next_record;
  end loop;
end;

Similar Messages

  • Problem in UPDATE statement In Multiple Record Block

    Hi Friends,
    I have problem in update Statement for updating the record in multiple record data Block.
    I have two data Block the master block is single Record block and the 2nd data block is Multiple Record data Block.
    I am inserting the fields like category,and post_no for partiular job in single data block
    Now in second Multiple Record Data Block,i am inserting the multiple record for above fileds like no. of employees work in the position
    There is no problem in INSERT Statement as it is inerting all record But whenever i want to update particular Record (in Multiple Block) of employee for that category and Post_no
    then its updating all the record.
    my code is Bellow,
    IF v_count 0 THEN
    LOOP
    IF :SYSTEM.last_record 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
    VALUES(g_post_no, g_roster_no, g_category, :POST_HISTORY_MULTIPLE.idcode, :POST_HISTORY_MULTIPLE.joining_post_dt,
    :POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    next_record;
    ELSIF :SYSTEM.last_record = 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
    VALUES (g_post_no,g_roster_no,g_category,:POST_HISTORY_MULTIPLE.idcode,
    :POST_HISTORY_MULTIPLE.joining_post_dt,:POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    EXIT;
    END IF;
    END LOOP;
    SET_ALERT_PROPERTY('user_alert',ALERT_MESSAGE_TEXT, 'Record Updated successfuly' );
    v_button_no := SHOW_ALERT('user_alert');
    FORMS_DDL('COMMIT');
    CLEAR_FORM(no_validate);
    Please Guide me
    Thanks in advence

    As you do a loop over all the records in the block, of course every record is updated.
    Also, what you do is not the way is intended to be used. In general, you base a block on a table,then there is no need at all for writing INSERT's or UPDATE's. Forms also know's then, which records to be updated and which not.

  • How can I compare values in a multiple records block

    I have a form with multiples records whit a date in each record. I need test if the date typed in record 2 is greather than the date on record 1, if the date typed in record 3 is greather than the date on record 1 and so on. How cai I do it???is grather than the date on record 1

    Pedro,
    Venelin's code works perfectly, but if you try to use it in a When-Validate-Item or When-Validate-Record trigger, it won't work since you can't invoke navigation routines (FIRST_RECORD, NEXT_RECORD) from these two triggers (among others).
    First, we have to understand that Forms wasn't built to perform multi-row validations. It's a fact.
    Second, the way I prefer to do this is: let the user enter the data as he wants.
    When he commits, in a POST-FORMS-COMMIT trigger, you can check the values using SELECT statements, because they are already written to the data tables. If you don't like them, just issue a RAISE FORM_TRIGGER_FAILURE and the transaction gets rollbacked (and the inserts will be undone).
    Hope this helps,
    Pedro das Neves

  • Disable checkbox in multiple record block with form personalization in r12

    hi
    i try to personalized form 'Autocreate Document' in purchasing super user responsibility in R12
    i want to disable some checkbox in block REQ_LINES that meet some criteria
    but why when personalized run, it disable all checkbox in all record in block REQ_LINES
    --Condition--
    Event trigger     : WHEN-VALIDATE-RECORD
    Trigger object    : REQ_LINES
    --Action--
    Type               : property
    Language         : all
    Object type     : item
    Target Object     : REQ_LINES.SELECT_LINE
    Properti name     : enabled
    value               : false
    please give me advice about this
    thank you very much for help

    I recommend you these forums for your question:
    Forums Home » Oracle Technology Network (OTN) » Products » Database » JVM
    Java in the Oracle Database
    Forums Home » Oracle Technology Network (OTN) » Technologies » Java » Java Server Pages (JSP)
    Java Server Pages (JSP)
    Forums Home » Oracle Technology Network (OTN) » Technologies » Java
    http://forums.oracle.com/forums/index.jsp?cat=24
    Joel Pérez

  • Display multiple record block in multiple canvases

    Hi,
    I am facing a problem while creating multiple canvases with the same blocks.
    I have block A, B, C. Block B and C are detail of A. I want items from blocks B and C to appear in multiple canvases. I tried doing the synchronize with item. It works fine but I cannot see the scrollbar in other canvas. Is it possible to show scrollbar in multiple canvases?
    Thanks in advance.
    DK

    If you mean that you want the scrollbar of the same block to be appeared on multiple canvases where items of this block are placed in different canvases... unfortunately... you cannot....
    Greetings...
    Sim

  • Sort multiple records with textfield

    Hi everyone!
    I want to sort from the backend all the products in a site.
    First, i use the repeat region server behavior, to list all the products. Added a textfield in each record, with the value of it's position (1, 2, 3, 4, etc).
    How can i update that?
    Just like Joomla! has in it's backend. A list with all the articles created, and the ability to change the order of the articles, changing it's number and pressing "save".
    Hope you guys understand me, my english is very very poor...
    Thanks in advance
    Cheers!
    A pic to better understanding:

    Since you refer to Joomla, I presume you want to do this with PHP/MySQL.
    Basically, you need to put your repeat region in a form, and submit the values of the product IDs and the new order numbers as arrays. To do this with PHP, you add a pair of square brackets after the form elements' names like this:
    <input type="text" name="product_id[]" value="....
    <input type="text" name="order[]" ...
    When the form is submitted, $_POST['product_id'] will contain an array of the primary keys, and $_POST['order'] will contain an array of the values inserted in the order text boxes.
    You then need to create a loop to update the existing records in the database. The following is not the full code, but should show you the basic principle:
    // connect to database
    for ($i = 0, $len = count($_POST['product_id']); $i < $len; $i++) {
        $sql = 'UPDATE products SET order = ' . mysql_real_escape_string($_POST['order'][$i]
               . ' WHERE product_id = ' . mysql_real_escape_string($_POST['product_id'][$i];
        mysql_query($sql);
    This loops through the $_POST['product_id'] array and updates each record with the appropriate value for order. The SQL query assumes that both product_id and order are numeric data types.

  • Mouse hand over a block of multiple records help

    Hello ,
    i have add a bean i my form so that i could change the cursor to a hand when the mouse is over an item.
    the problem that i have is that the block is a multiple record block i am showing 5 records.
    so the mouse change only in the first record and not in the other records
    has any one try to do the same and came with a solution?
    or does anyone know how could i solve this problem?
    thanks
    ana

    Hello Jan
    i have this class
    import java.awt.Graphics;
    import java.awt.Color;
    import java.awt.FontMetrics;
    import java.awt.Font;
    import oracle.forms.ui.VTextField;
    import oracle.forms.properties.ID;
    import oracle.forms.handler.IHandler;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.Cursor;
    public class Hotlink
    extends VTextField
    private Cursor stdCursor;
    private Font stdFont;
    private int stdStyle;
    private Color stdForeColor;
    private Color stdBackColor;
    public Hotlink()
    super();
    public void init(IHandler h)
    super.init(h);
    stdCursor = this.getCursor();
    this.addMouseListener(new MouseAdapter()
    public void mouseEntered(MouseEvent me)
    if(getTextLength() > 0)
    ((VTextField)me.getSource()).setForeground(Color.red);
    ((VTextField)me.getSource()).setBackground(Color.lightGray);
    setFont(stdFont.deriveFont(Font.BOLD));
    setCursor(new Cursor(Cursor.HAND_CURSOR));
    public void mouseExited(MouseEvent me)
    if(getTextLength() > 0)
    ((VTextField)me.getSource()).setForeground(stdForeColor);
    ((VTextField)me.getSource()).setBackground(stdBackColor);
    setFont(stdFont);
    setCursor(stdCursor);
    public void paint(Graphics g)
    super.paint(g);
    if (this.getTextLength() > 0)
    FontMetrics metrics = getFontMetrics(getFont());
    int strWidth = metrics.stringWidth(getText());
    int yoffset = (int)(metrics.getHeight() * 0.95);
    g.drawLine(0, yoffset, strWidth, yoffset);
    public boolean setProperty(ID pid, Object value)
    if(pid.getName().equals("FOREGROUND")) this.stdForeColor = (Color)value;
    else if(pid.getName().equals("BACKGROUND")) this.stdBackColor = (Color)value;
    else if(pid.getName().equals("FONT")) this.stdFont = (Font)value;
    return super.setProperty(pid, value);
    and i had make a jar with it inside the text item i have put the reference to this class the thing is that it work with the 1º record also

  • Block with multiple records

    hi every one
    i've developed a form containing a multiple record block. i need that some functions to be done before i commit it.
    1. its primary key should b auto generated, usually i handle it by selecting max value(primary key field) from data base and adding one but in this case it wont work bcoz it wont go to database before i commit it. so it wont auto generate it.
    2. second problem is that there are some fields that must b filled but it should prompt the user to enter required fields when he press commit button.
    thanks in anticipation
    kabir

    Have you considered creating a sequence object for the primary key. If the datatype of the primary key is NUMBER then a sequence will auto generate the next value if you placed (:your_sequence.next_val) into the dafault value property of the text item.
    The second problem can be overcome by writing a When-Validate-Item trigger whereby the user will be prompted to the item that contained the required field that was not entered. You should however note that if a coulmn in your table is of the NOT NULL type then the form default behavior is to prompt user to enter the field.

  • Check box Item property in mutiple record block

    Hi,
    I have migrated a number of forms from 6i to 10g. All seems to be working apart from a problem with the display of check boxes that are part of a multiple record block. The item property for the checkbox has font weight set to bold and this works fine on the 6g version. On the 10g version it is displayed as normal font weight.
    Any other items in the record, text items etc are displayed in bold correctly.
    As this seems to affect a lot of forms is there some patch/fix that I should have applied or is this just the way it is?
    I am trying to use set_item_instance_property to set them manually but that doesn't seem to make any difference.
    Thanks in advance and Happy Christmas/New Year.

    Problem solved following response from Oracle support desk -
    UPDATE
    ======
    Hi Dave,
    When using lookandfeel=generic, the colors for different Windows items (e.g., menu, check
    box, window background ...etc) are taken directly from the Operating System
    (OS) user settings. I tested the issue with lookandfeel=oracle and with
    colorScheme set to different values, and check box tick in this case takes the
    same color as the color scheme used.
    I suggest then using dark color scheme to give you a similar effect as it was in Forms 6i. for example:
    colorScheme=Titanium

  • How to change the Height of item....!!!! in multi record block

    Here is the problem I want to change one item height in multiple records block..
    I tried to do the following
    set_item_instance_property(:system.mouse_item,:system.current_record,height,50);
    But this didn't work as the property for height couldn't be used with this built in..
    Can any one tell me any other suggestion to move around
    Thanks and best regares

    If you just have two sizes to display - e.g. normally the item is 1 line high but in the current item you want to show more information and want to make it say 2 lines high, then you can use a Mirror item to do this.
    Create another item in the block - set the Synchronize With Item property to the base item you want to "Resize".
    Set the Records Displayed property to 1 for this extra field.
    Put this field on a stacked canvas that is just big enough to hold it.
    The in your When-New-Record Instance trigger you can pop the stacked canvas up over the normal version of the field.
    That should do the trick.

  • Disabling radio buttons in multi record block

    Need to be able to disable/enable one or more radio buttons in a group dynamically in multiple record block. Tried setting enabled properties but it sets for all records in the block. At the very least, I need to reset an item using radio to previous value if setting is invalid but when-radio-changed has already set value. Thank you.

    Your one row record has 5 items, then I assume empno, ename, ssn, phone, deptno 5 items on your multi-record block.
    you entered first row record as,
    empno, ename, ssn, phone, deptno
    100 John Smith 123-45-9999 234-333-9999 2
    101 Al Brown 222-34-1111 123-456-7890 2(duplicated)
    You want your code to duplicate the second deptno record as 2 instead of typing in, right?
    If so, then you add KEY-NEXT-ITEM trigger on item :phone, inside put,
    go_item('deptno');
    duplicate_item;
    It will copy the first deptno record 2 for the second record as showed above.

  • Changing colors of individual records in multi-record block

    Can any point me to where I should place the code to programmatically change the color of a record in a multi-record block based on a particular column value?
    For instance, if block.col1='OPEN', I'd like the entire row to display as BLUE. If block.col1='CLOSED', I'd like the entire row to display as RED. I've tried placing my code at the block POST_QUERY level and WHEN_NEW_RECORD instance level without success.
    I'm a relative forms newbie, so any advice would be appreciated.

    I tried putting it in the 'when new record instance' trigger but it did not work completely. I put them same code in the Post_Query trigger of the multiple record block along with the 'When new record instance' trigger and it worked perfectly.
    I'm not forms expert, and there's probably a reason why I needed to put it in two places to make it work for me but that's a question of a forms expert.
    Ron

  • How do I add multiple text block records from text file?

    The data manager documentation (page 151) for MDM 5.5 SP3 indicates that one or more new text blocks can be added to the Text Blocks object table from files. It is noted that the files must be plain text files.
    I use notepad and create a text file with two lines as follows:
    Test 1
    Test 2
    When I try to add the text blocks following documentation mentioned above, it only adds one record for the Data Group I have chosen and the record contains the entry "Test 1" from the first line in the text file.
    How can I add multiple records to the data group from a file?

    From my testing it appears that you need to have one text file per text block record in Data Manager.
    I wrote VBA macro to so that I could input my text blocks into an Excel spreadsheet and then the macro will take the contents of each cell in a highlighted column and create one text file per cell.
    Then using Data manager, I can select all of the text files at once and it will import them, creating one record per text file.

  • Retrive Multiple Records Into A database Block

    hi, all
    i would like to know if there is any document or references wich illustrait the way of retriving Multi records from a procedure built on database side into a database block using form 6i ??
    My Problem is : i create a procedure in the database which retrive a multiple records and the variable from procedure (out) are the same value from Form side (in). but it always fetch the whole records at the same record position in the block as the cursor raised on . i found a way explian how to mintain a set or record using a record type and create a table of that record type , but still don't' know how deal calling the procedure from the form side .
    Any advice of this issue will be greatfull and if sample of code provided will be better
    Thanks in Advance
    Regards
    Omar

    You can try something like this:
    PROCEDURE POPULATE_BLOCK IS
    cursor c1 is
    SELECT <your column names>
    FROM <your table name>
    where <your where condition>
    BEGIN
    open c1;
    go_block('<your block name');
    first_record;
    loop
    fetch c1 into
    :<your block name>.<your column name 1>,
    :<your block name>.<your column name 2>,
    etc,etc
    exit when c1%NOTFOUND;
    next_record;
    end loop;
    close c1;
    first_record;
    END;
    so your code might actually look something like this:
    PROCEDURE POPULATE_BLOCK IS
    cursor c1 is
    SELECT distinct
         a.pog_dept
         ,a.pog_number
         ,a.pog_level
         ,a.pog_id
    ,a.start_date
         ,a.transmit_date
    ,a.deactivate_date
         ,b.pog_description
    FROM pog_stores_msi a, pog_master_msi b
    where a.pog_dept = :b_main.bi_dept
    and a.pog_number = :b_main.bi_pog_number
    and a.pog_level = :b_main.bi_pog_level
    AND A.POG_ID = :B_MAIN.I_POG_ID
    and a.pog_dept = b.pog_dept
    and a.pog_number = b.pog_number
    and a.pog_id = b.pog_id;
    BEGIN
    open c1;
    go_block('b_main');
    first_record;
    loop
    fetch c1 into
    :b_main.bi_dept
    ,:b_main.bi_pog_number
    ,:b_main.bi_pog_level
    ,:b_main.i_pog_id
    ,:b_main.i_start_date
    ,:b_main.i_transmit_date
    ,:b_main.i_deactivate_date
    ,:b_main.i_pog_desc;
    exit when c1%NOTFOUND;
    next_record;
    end loop;
    close c1;
    END;
    Hope this helps,
    NumbNutz

  • Problem In Update Statement In Multiple Record Data Block

    Hi Friends,
    I have problem in update Statement for updating the record in multiple record data Block.
    I have two data Block the master block is single Record block and the 2nd data block is Multiple Record data Block.
    I am inserting the fields like category,and post_no for partiular job in single data block
    Now in second Multiple Record Data Block,i am inserting the multiple record for above fileds like no. of employees work in the position
    There is no problem in INSERT Statement as it is inerting all record But whenever i want to update particular Record (in Multiple Block) of employee for that category and Post_no
    then its updating all the record.
    my code is Bellow,
    IF v_count <> 0 THEN
    LOOP
    IF :SYSTEM.last_record <> 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
    VALUES(g_post_no, g_roster_no, g_category, :POST_HISTORY_MULTIPLE.idcode, :POST_HISTORY_MULTIPLE.joining_post_dt,
    :POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    next_record;
    ELSIF :SYSTEM.last_record = 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
         VALUES (g_post_no,g_roster_no,g_category,:POST_HISTORY_MULTIPLE.idcode,
              :POST_HISTORY_MULTIPLE.joining_post_dt,:POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    EXIT;
    END IF;
    END LOOP;
    SET_ALERT_PROPERTY('user_alert',ALERT_MESSAGE_TEXT, 'Record Updated successfuly' );
    v_button_no := SHOW_ALERT('user_alert');
    FORMS_DDL('COMMIT');
    CLEAR_FORM(no_validate);
    Please Guide me
    Thanks in advence

    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;These update statements are without where clause, so it will update all records.
    If it is specific to oracle forms then u may get better help at Forms section.

Maybe you are looking for

  • Domain Replication Issue. Is there Any Process can be monitored in task Manager which is responsible for REPLICATION?

    Hi,    There is an issue with Secondary domain controller replication. I am interested in the "Windows Process" which is responsible for Replication.   We have a 3rd party tool in our project which generate alarm when a windows process in not running

  • Strange IDE behaviour on i915GM Speedster

    Hello all, I've a small problem : I can connect my DVD reader or my DVD writer, but not both at the same time! If I connect both (only one P-ATA port on this motherboard), Windows freezes just before user login or sometimes just after getting on the

  • String to DATS format Conversion

    Hello Experts, I am using Powerbuilder system to get my Legacy data.In Powerbuilder Date needs to be supplied in STRING format.So I am giving String Format (dd-mmm-yyyy). However, at SAP end, Date needs to be in DATS format (Standard SAP yyyymmdd) .

  • HIERARCHY load from R/3 does not complete

    Hi there gurus, I am trying to load the 0GL_ACCOUNT hierarchy master data, but it never finishes. The attributes and text loaded successfully. We have already successfully installed the BC on R/3, then replicated it in BW, then installed the BC in BW

  • Saving model state in ApplicationHandler (or where?)

    Where is the right place to save the state of a model bean during the request lifecycle? In the ApplicationHandler? Suppose I have a form and want to persist the data to a database after the user submits the form (and validation is complete). <jsp:us