Updating a table on button press

Hello,
I am trying to make a simple APEX function that allows the user to click a button on the page which corresponds to a team. I am using page processes once the button is pressed to increment the points value for the specific team by 1. An example of one of the processes is:
UPDATE teams
SET number_of_points = number_of_points + 1
WHERE team_colour = 'Blue';
This piece of SQL is executed on the page submit and when the button is pressed.
Unfortunately, no matter which button is pressed, all of the page processes are fired and all teams gain when point. How can I make it possible for the process to only effect the team for which the button corresponds to.
Thank you so much!

you wrote different process for different actions right?
and you wrote
The problem is still occurring. I'm no sure why though. I could only assume it was because in image one the trigger is set to fire on submit. Should I stop the buttons from having 'Go' in the field that controls the button actions?
please give full information or create a sample application in apex.oracle.com/pls/apex then will see,
Regards,
Pavan

Similar Messages

  • Update command in When-button-pressed.

    Hello OTN members,
    I have the following situation :
    Take an eg.
    There are two forms, the first form takes the fiedls such as EMP
    NAME, ADDRESS AND DEPT. This record generates a Empid from the
    sequence.
    The second form selects the empid from the LOV, and other fields
    such as Emp Salary, Commission and Bonus Rate(from the same
    table) are entered. When a Button is pressed, it should update
    the record with the above values where empid in the table is
    equal to the empid in this forms first field.
    I tried as below in when_button_pressed trigger::
    UPDATE EMP SET SALARY = :EMP_BLOCK.SALARY,
    COMMISSION = :EMP_BLOCK.COMMISSION etc
    where
    EMPID = :EMP_BLOCK.EMPID;
    The above statement does not update the record in the table.
    If there is any other approach for the above please suggest.
    Thanks in advance.
    Sailesh.
    null

    Hallo,
    you can check the number of updated row with the system variable
    SQL%ROWCOUNT. So if your where condition doesnt match any rows,
    no rows will be updated and also no error message will be
    generated. In this case SQL%ROWCOUNT contains 0 after the update
    command.
    other idea: make surte to commit your changes before querying
    the record from another sessuion!
    Sailesh (guest) wrote:
    : Hello OTN members,
    : I have the following situation :
    : Take an eg.
    : There are two forms, the first form takes the fiedls such as
    EMP
    : NAME, ADDRESS AND DEPT. This record generates a Empid from the
    : sequence.
    : The second form selects the empid from the LOV, and other
    fields
    : such as Emp Salary, Commission and Bonus Rate(from the same
    : table) are entered. When a Button is pressed, it should update
    : the record with the above values where empid in the table is
    : equal to the empid in this forms first field.
    : I tried as below in when_button_pressed trigger::
    : UPDATE EMP SET SALARY = :EMP_BLOCK.SALARY,
    : COMMISSION = :EMP_BLOCK.COMMISSION etc
    : where
    : EMPID = :EMP_BLOCK.EMPID;
    : The above statement does not update the record in the table.
    : If there is any other approach for the above please suggest.
    : Thanks in advance.
    : Sailesh.
    null

  • Updating a column when button  pressed

    Hello,
    I have a ADF master detail table and in the detail table and I would like to add a button. When user select a row and presses the button, I need to update a column value to 'Y'. How can I do this?
    I need to have a Yes or No prompt as welll before it gets updated in the db table.
    How can I acheive this.
    Thanks a lot.

    Hi,
    if you use ADF, on the button action method, access the ADF biinding, get a hande to the iterator and call getCurrentRow() on it. The set the attribute that represents the column and set Yes or No to it.
    Make sure you use PPR to refresh the table when teh button is pressed
    Frank

  • Something has happen my ipad air 2 it wont let me download or update any apps, when I press the button do update or download it looks like it is but it doesn't so if anyone knows what's going wind please help me

    Something has happen my ipad air 2 it wont let me download or update any apps, when I press the button do update or download it looks like it is but it doesn't so if anyone knows what's going wind please help me

    Do you have any restrictions for purchasing apps on the phone? Settings > General > Restrictions. If you have a Mac computer or another Apple device can you purchase things in the App Store using the same Apple ID on something else?

  • Looping through a table Help needed ....Forms 10g..... When Button Pressed

    Hye craig, hamid, christian and all ...........
    i have a user access interface which i create where there are two fields username and password and a button,
    i have also created a table USERS for users which have username and password fields ..... On useraccess interface i coded on WHEN BUTTON PRESSED like this
    declare
    go_block('users');
    execute_query;
    declare
    begin
         if :useraccess.username=:users.username and
              :useraccess.password=:users.password then
              go_block('MAINPAGE');
              else
              go_block('USERACCESS');
              MESSAGE('SORRY WRONG PASSWORD OR NOT A REGISTERED USER');
              MESSAGE('SORRY WRONG PASSWORD OR NOT A REGISTERED USER');
              end if;
    end;
    This code works for a single user in USERS table but for multiple users there has to be some looping system
    which matches the USERACCESS and USERS tables fields thoroughly ....

    Hi Majid,
    I can suggest you a workaround for this. raise a ON-LOGON trigger and you can use the LOGON_SCREEN builtin to flash the logon screen at runtime. And then try capturing the username and password.
    DECLARE
      connected BOOLEAN := FALSE;
      tries     NUMBER  := 3;
      un        VARCHAR2(30);
      pw        VARCHAR2(30);
      cs        VARCHAR2(30);
    BEGIN
      SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
      WHILE connected = FALSE and tries > 0
      LOOP
        LOGON_SCREEN;
        un := GET_APPLICATION_PROPERTY( USERNAME );
        pw := GET_APPLICATION_PROPERTY( PASSWORD );
        cs := GET_APPLICATION_PROPERTY( CONNECT_STRING );
        LOGON( un, pw || '@' || cs, FALSE );
        IF FORM_SUCCESS
        THEN
          connected := TRUE ;
        END IF;
        tries := tries - 1;
      END LOOP;
      IF NOT CONNECTED THEN
        MESSAGE('Too many tries!');
        RAISE FORM_TRIGGER_FAILURE ;
      END IF;
    END ;   a sample piece of coding to help you out.
    Regards,
    Manoj Chakravarthy

  • My bookshelf and Facebook icons are stuck in "waiting" apparently updating for more than a week, but I don't remember trying to update them.  I tried pressing the home and sleep buttons in as suggested, but problem not fixed

    My bookshelf and Facebook icons are stuck in "waiting" apparently updating for more than a week, but I don't remember trying to update them.  I tried pressing the home and sleep buttons in as suggested, but problem not fixed

    Keep to one discussion only. Go back to this one,
    https://discussions.apple.com/message/21087117#21087117

  • HT201263 APP store indicates 1 update.  Press "store", "loading" briefly on screen then white screen with updates bar on top.  Press updates button in lower right; nothing happens frozen with white screen and still indication 1 update.  Other store featur

    APP store indicates 1 update.  Press "store", "loading" briefly on screen then white screen with updates bar on top.  Press updates button in lower right; nothing happens frozen with white screen and still indication 1 update.  Other store features and ipod work ok

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Go to Settings>iTunes and App Stores and sign ut and sign back in
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar          
    Also see:
    https://discussions.apple.com/thread/4751197?tstart=0

  • How to create a Maintenance view in order to update 4 tables

    Hello,
    I want to update 4 tables having the same key. MANDANT + SIRET (fiscal french ID).
    I try to create a maintenace view, i need to update the 4 tables using a single screen.
    When i use the relationship the system display a message "Relationships with unsuitable cardinality"
    The first table contain only the ID, the 3 others contains some informations (adress, name, and others)
    Thanks for your help
    Christophe

    Hello,
    you could check, if your other three tables have a correct foreign key definition on the field  SIRET.
    Tranaction SE11 -> pstion on the field and press the foreign key button.
    Check Table has to be your first table; cardinality has to be 1 :1 or 1 to N.
    Regards Wolfgang

  • How to update a table in database

    Hi.
    i am working on HR system. I have developed a form of report engine. Report Engine form contains no any database table but text items, buttons and options.
    I have placed a button and in its when button press triger i wrote a procedure to update a table record as:
    Update Empbiodata
    Set Status = 'Retired'
    Where Status = 'On Duty'
    but that button is not updating the database record. when i add a line of Commit_form, after that i faced the error message there is no change to save.
    I have run this code on SQL prompt and saw working well.
    please solve the problem that why this code is not working in button press trigger in the form.
    thnx

    Hi Zaheerms,
    You can do this kind of updates in the Forms.
    I will help u in this scenario.
    1st tell me the update column is a database item or not ?
    Sample code :
    begin
    Update Empbiodata
    Set Status = :block.column_name --'Retired'
    Where Status =:block.column_name -- 'On Duty'
    commit;
    -- For checking message
    fnd_messahe.set_string('Testing'||:block.column_name);
    fnd_message.show;
    end;
    and give some condition as per ur requirement.
    I think so this will help you.
    If not post again and i will try to clarify you.
    thanks,
    SIvaprasad

  • Need a pattern to update a table's contents

    The goal here is to update a table's data when new data is imported into my application.
    I was looking thru the Swing trail and see that the TabelModelListener is more appropriate for when the data in the table itself changes -- I cannot find a good trail to base my codes off of.
    more details:
    1. the import is fired off via a button press.
    2. On that button defined a listener, in which I call a service that handles the import.
    3. The import gathers data from a text file and updates a DB.
    It seems to me that after the import, I would want to fire an event, for which the table (or tablemodel) is listening, so it can update itself. I can't find out how to do this. Help is appreciated.

    I think I might be on the correct track.
    1. I am using Factory pattern to serve out gui elements.
    2. In that factory I have created a static Observable object.
    3. I have created a subclass that implements observer. In the update method I can reset the tablemodel. In the factory I create and instance of my table class and register it on the Observable.
    4. After I import some data, i simply call the appropriate method on observable, and my table should do its update.
    I think this solution is pretty clean. If anybody has a better suggestion please let me know. I am always interested in writing the cleanest/most elegant code possible.

  • [ADF BC | ADF Faces] Updating a table with values updated in transaction

    Summary: A table is based on a view with a bind variable. Based on some action, I update rows in the view so that they no longer satisfy the query. How do I update the table to reflect this?
    I have an ADF Faces page with a multi-select table component on it, mapped to an ADF Business Components view object. The view object has a bind variable (:Status), which is used in the query to only retrieve rows with a specific status.
    The user selects rows in the table that should have their status changed, and then hits a button to perform the action. In the backing bean for the page, the button click is processed and the selected rows are updated to a different status. At this point the transaction is not committed.
    Changing the status of these rows now means that they no longer match the where clause of the view object, yet they still appear in the table.
    My question is, how can I update the table so that rows which don't match the where clause are removed?
    This is a simplified version of the problem I am working on - this needs to work when rows that aren't in the table are being updated so that they now MATCH the where clause and rows may also be added or completely removed.

    Quite an interesting little problem....
    I have created a simple test case to illustrate your scenario - perhaps Steve M could comment...
    My scenario:
    1). create an EO based on the HR.EMPLOYEES table
    2). create an updatable VO based upon the aforementioned EO. Add "COMMISSION_PCT IS NULL" to the where clause.
    3). Add the VO to an app module as usual.
    4). Create an ADF Faces page by dropping the VO from the data control as an ADF table. Show only first name, last name, and commission pct.
    5). Add a command button to the page so I can call various code from the backing bean.
    Now, when I update the commision for the first record to ".1" and press the submit button (the one in the table actions facet), the update "takes" - I assume that it's just in the EO cache at this point. The record still shows on the screen, even though it no longer meets the where clause criteria.
    When I add some code to the command button (#5) to perform a commit - the record STILL shows on the screen after committing to the DB. I can make the record disappear by either (in the same backing-bean method that does the commit)
    a). Re-execute the iterator after the commit
    b). Call "clearVOCaches" on the application module (forces the iterator to re-execute)
    I even tried programmatically adding the where clause back in (via addWhereClause) and re-executing the iterator - no go. I suspect that the only way to do this would be to post the changes to the DB (without committing them) and then re-execute the query. This, however, would be a killer from a scalability perspective.
    John

  • Urgent : update of table QALS  through transaction QA12 after save

    Hello Experts ,
      I need to update the table field SELHERST of standard table QALS through transaction QA12 after the save button is clicked  .
    I have implemented the exit QEVA0010 which is triggered after clicking the save button , and have put the update command there , followed by commit work statement .
    But it is not updating the table QALS .
    Thanks in advance ....

    When the SAVE button is pressed, SAP execute some checks and launch the update task, if you want that your changes are not overwritten by SAP you need to submit those for execution during update task.
    So you need to use instructions like
    - PERFORM ON COMMIT
    - CALL FUNCTION IN UPDATE TASK
    and execute the update in one of these. (Reference [Updates in the R/3 System (BC-CST-UP)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCSTUP/BCCSTUP_PT.pdf])
    You may also try to force the update in the main program, declaring a pointer (field symbol) in the calling program data '(SAPMQEVA)QALS'  (But that's not very correct)
    Regards

  • FRM-40735 WHEN BUTTON PRESSED TRIGGERRAISED UNHANDLED EXCEPTION ORA-01407

    WHILE I AM TRYING TO UPDATE A TABLE LIKE:
    update mis_dik_adeia
    set trexon_etos_days = (select days_per_year
    from mis_dik_adeia, mis_plafon_adeivn
    where mis_dik_adeia.adeia_id = mis_plafon_adeivn.adeia_id
    and mis_dik_adeia.adeia_id between aapo and aews
    and mis_dik_adeia.employee_id = apoerg
              and mis_dik_adeia.etos = etos1
              and mis_plafon_adeivn.years_yphr = ( select max( a.years_yphr ) from mis_plafon_adeivn a where a.adeia_id = mis_plafon_adeivn.adeia_id     and a.years_yphr <= eth ));
    AND THE COMPILER DOESN'T GIVE ANY ERROR, I TAKE THE BELOW ERROR!
    FRM-40735 WHEN BUTTON PRESSED TRIGGERRAISED UNHANDLED EXCEPTION ORA-01407

    there are two categories of errors: compile-errors and runtime-errors.
    In this case the syntax of statement seems OK (no compiler warnings) but running the code gives you a ORA-01407.
    Look in your manual which error occured in your form.
    Or use error_code and error_text in your Exception-Handling to get those errors in a better readable way.
    try it
    Gerd

  • Update multi tables in one page

    I need to create a page that allow users to update ( no insert, no delete) 2 tables 1 view.
    home page users enter a record_no, then I pass the rec_no to p2 which has 3 regions. Each region points to one table\view respectively. All tables\view are linked by a same rec_no. Each region has a form on table with buttons: cancel,save.
    This works fine with only one region but When I start putting 2nd region,
    following issues arise
    1. data only display on most recently added region( form), it won't display on both regions
    2. when I click apply changes (save) on region 1, it erros on both regions that have not null columns. I think this is because it can't tell the difference on the button that I press.
    Is it possible to achieve this goal: update multiple tables in one page ? What is the best way to do it ?
    I don't want to use form with a report because it has extra page to go through.Ultimate goal is to make all regions Hide and show, so data won't clog whole screen if user has no need to see all at once. Is creating a view of these 3 tables\view the way to go ?
    Can you help ? My brain is fried now.
    Thanks.
    Tai

    Hello Tai,
    I understand your frustration. Sometimes, something that should seem easy turns out to be so difficult. In this case, what you can do is this:
    1. Get rid of the buttons in the second and third region. You can drive your updates all from only one set of buttons.
    2. Set a condition on your update button that it only do the update if all three regions data have been filled in - that is - the fields you need are NOT NULL.
    Sometimes, I have actually created a separate region called "Buttons" and that is all that resides there. When I have multiple regions on a screen that need input, I won't do any of the updates until all areas have been populated.
    As for hiding/displaying the various regions based on your user's need to see them, you can also set conditional display on the region so the user won't see them if they don't need to.. And/or use the hide/show region template.
    I hope this helps,
    Don.
    You can reward this reply by marking it as either Helpful or Correct :)

  • Change control values on button press

    Hi, I've got a situation where I have several numeric controls where you can change different values. I also have several subVIs with control references (as described in this article: http://labviewwiki.org/Control_References) that takes in references to these numeric controls on the mainVI. These subVIs continously read the values in their own threads.
    So whenever I change a value on any of the controls, the values does of course change in the subVIs, since they reference to the value of the control.  How would I make the actual value only change only after I clicked the ok button?
    To illustrate this I made a VI with an event structure and a separate while loop that continoulsy reads a reference to the control and updats an indicator. I can think of a few cumbersome solutions, whereas I have two controls for every value. The second control would then be hidden and only written to in case of the Ok button press. But having two controls to do something simple as this seems superfluous.
    Message Edited by Siniz on 10-20-2009 10:36 AM
    Solved!
    Go to Solution.
    Attachments:
    ValueChangeOnButtonPress.vi ‏19 KB

    Given what you want to do then I would suggest that you use an Action Engine to contain your data. This has the advantage of decoupling the UI from the subtasks. I would recommend that your action engine consist of an array of clusters. Each cluster would contain the data values, in your case Ki, Kd and Kp for each controller. This has the advantage of reducing the individual values you are dealing with and treats the data for a given controller as a whole. The subtasks could either poll the data looking for a value change. You could even keep track of that in your Action Engine so you would only need to poll to see if the data changed. If it did, then read the data. You would need an index or ID to specify which controller's data you would want to access. The action engine allows you to grow your application if more controllers are added. You should use a typedef to define the cluster. If you wanted to make this more event driven you could use a single notifier shared by your subtasks that would simply indicate a data change event. Part of the data for the notifier could specify which data. That way only interested subtasks would take action. This type of architecture wouldn't add lots of wires to your diagram especially if you used a named notifier.
    Regardless of the way you choose to pass the data to the subtasks I would take a look at your UI. I haven't seen it so I can't comment on it specifically. However is you have 40 controls on the front panel at the same time it most likely is a confusing interface. There are ways to reduce the complexity and still provide the same functionality. If you haven't already looked at I would recommend getting the book The LabVIEW Style Book by Peter Blume. If you did reduce your UI to only work with a single controller or a couple of related controllers at a time the Action Engine approach would work nicely since you take your data from the FP and only update the data that has changed. From a UI perspective you have less controls to worry about on your UI and it will probably be easier for the user to understand. From the application's perspective you have decoupled the subtasks from the UI in a very clean way. Another approach would be to use LVOOP for your controller data and processing. Then you simply instantiate a new instance of the class (an object) for each controller that your system is using. This has an added benefit of allowing you to use different controllers and load them at runtime using dynamic dispatching.
    PS You are good for the overall Kudo count. Thanks.
    Message Edited by Mark Yedinak on 10-20-2009 12:33 PM
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

Maybe you are looking for

  • Help need to convert hsa prog to an applet

    Hey everybody I have no clue what i am doin im trying to convert a mathquiz program from the hsa console to an applet. ive attached my hsa code: import java.awt.*; import hsa.Console; import java.io.*; public class MathQuizhsa static Console c; // Th

  • Air won't function after detaching from display

    Hi, I attached my MacBook Air to a monitor today. I forgot to put it to sleep (as recommended) before detaching the connecting cable. Went home. Just opened it up and can't get it to function. The desktop comes up but the track pad movements aren't r

  • Function module - convert to local currency

    Dear all, I need to use a function module to convert to local currency a document that has been posted in foreign currency, which function module can I use? I tried convert_to_local_currency but I dont get any output... Else I need a function module

  • Go To Frame Label action

    Please help!! I have a drop-down menu that I created inside a movie clip. Each drop down has a button behind it. What I am trying to do is make it so when each button behind each menu item is clicked it goes to a particular frame (label) on the Main

  • Oracle query output size

    Hi, How to findout the sql statement output size...? Thanks, Edited by: Jaya.ilankovan on Nov 28, 2011 1:26 PM