Insert statement in when-checkbox-checked trigger doesn't work

in a when-checkbox-checked trigger, I wrote the follwing code :
IF :sunday = 'Y' THEN
msg_alert('Y','I',false);
pkg_var.v_day_count := pkg_var.v_day_count + 1;
msg_alert('1','I',false);
:schtm_skmk.day_id := '1';
msg_alert('2 ',I',false);
INSERT INTO schtm      
(ROUTE_ID, DAY_ID, FLIGHT_ID)
VALUES
(:schmf.ROUTE_ID, :schtm_skmk.day_id, 1);
COMMIT;
msg_alert('end insert schtm','I',false);
END IF;     
if the checkbox is checked, I assigned value '1' to day_id. Then, I want to insert a row into table SCHTM. But, the insert statement fail. The msg_alert '2' pop up. The msg_alert 'end insert schtm' does not pop up, meaning the insert statement fail. It also fail after I replace the insert statement with the exact value of the item. But if I execute this statement in SQL plus, it insert a row into the database.
What is strange here is it did work before, I successfully insert 2 rows into database. But when I test it again just a while later, it never work anymore.
Please help.
Thanks,
Shu Wen

It seems that you have missed ELSE. By the way there is only one INSERT ...

Similar Messages

  • Why Module level trigger contains "WHEN-CHECKBOX-CHANGED" trigger in Forms 6i?

    Hi,
    Why Module level trigger contains triggers like "WHEN-CHECKBOX-CHANGED", "WHEN-BUTTON-PRESSED" etc.? "WHEN-CHECKBOX-CHANGED" trigger is present in CheckBox & "WHEN-BUTTON-PRESSED" trigger in Button. Then why these triggers are also presnt in Module?
    Can anyone please clarify my doubt?

    There's a lot of triggers that are present at different "scopes". Like they exist at the item level, the block level,
    the module level...
    The idea is if you have an action that should only occur at that one single item it can do in the item trigger. If
    it's for all of them on the block, in the block level trigger. If for all of them ever, at the module level.
    For example suppose you wanted it to do a next_item after the trigger executed you can put that logic in the module
    level trigger. A key thing to notice here is the trigger hierarchy. That is essential to know about.
    Right click on one of these triggers in the object navigator. The execution hierarchy is override, before and after.
    since each of these levels of the same trigger has this execution hierarchy this is, well, potentially not easy to
    understand what is going to happen. I would typically have a per-item trigger be before and a higher level trigger
    be after.
    And this execution hierarchy thing is something I'd love to see enhanced in the gui. I wish it was a lot easier to see
    what the execution hierarchy is when editing a trigger text. I wish one could see and modify the execution hierarchy on the
    same screen as the trigger text and what would be really great is some way to tell how the trigger hierarchy will sort out
    at run time. For example if one is looking at an item level trigger it would be fabulous to know that as is, that trigger will be
    overridden by a higher level trigger and so on. Or vice versa if one is looking at a block level or form level trigger that it is
    overridden by a lower level trigger, or it will execute before or after some other trigger. I don't know what is defined to happen
    with various levels of triggers that have the same execution hierarchy. Like suppose they are all override,before,after.. then
    what happens? It'd be good to know.

  • TS1277 HI. I have followed all the appropriate steps above and when I try to enter my 'Password' when asked, my keyboard doesn't work. No key press can be activated at all when trying to enter my password in 'Terminal. And I am in the 'Administrator' user

    HI.
    I am having trouble authorising my Mac Air to my Itunes account. I found a discussion explaining how to go go into 'Terminal', then adding a command. I have followed all those appropriate steps and when I try to enter my 'Password' when asked, my keyboard doesn't work. No key press can be activated at all when trying to enter my password in 'Terminal. And I am in the 'Administrator' user. Can anybody offer any suggestions?? ta

    Does the command that you're trying to enter in Terminal begin with the word 'sudo'?
    If so, your keyboard is working fine. When you type your password after a sudo command, nothing is echoed to the screen for security reasons (not even the * that are normally registered in other user interfaces). However, the program is registering what you type.
    Just type your password and press 'return' and the command will be executed (so long as you type it correctly; if you don't, you'll get an error message).

  • How to assign value from insert statement to variable from a trigger

    Hi,
    I got this really annoying problem and I don't know if I am doing it correctly.
    I have a BEFORE INSERT trigger on a table. When someone executes an insert statement I want to grab the value of a column from that statement and assign it to a variable and then do stuff with it. I'm stuck on the assignment.. look below..
    CREATE OR REPLACE TRIGGER CARS.geotest2_trigger
    BEFORE INSERT ON CARS.GEO_TEST2
    FOR EACH ROW
    DECLARE
    v_chainkey nchar(32);
    v_chainkey2 nchar(32);
    not_exists EXCEPTION;
    BEGIN
    :NEW.CHAINKEY := v_chainkey;
    SELECT GEO_TEST.CHAINKEY INTO v_chainkey2 FROM GEO_TEST WHERE GEO_TEST.CHAINKEY = v_chainkey;
    IF v_chainkey2 = '' or v_chainkey2 is null THEN
    RAISE not_exists;
    ELSE
    INSERT INTO GEO_TEST2 VALUES(:NEW.CHAINKEY, :NEW.BLA, :NEW.FOO);
    END IF;
    EXCEPTION
    WHEN not_exists THEN
    RAISE_APPLICATION_ERROR(-20010, 'Chainkey does not exist in parent table GEO_TEST');
    END;
    I keep getting this error
    Error: ORA-04098: trigger 'CARS.GEOTEST2_TRIGGER' is invalid and failed re-validation
    SQLState: 42000
    ErrorCode: 4098

    It isn't assigning because v_chainkey is not at the left hand side of the assignment statement.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> declare
      2    x  number := 5;
      3    y  number;
      4  begin
      5    x := y; -- does not assign anything to y; assigns NULL to x,
      6            -- because y is NULL at this point
      7            -- so, essentially the value 5 of x is *LOST* now
      8    dbms_output.put_line('x = '||x);
      9  end;
    10  /
    x =
    PL/SQL procedure successfully completed.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G>In any case, here's what you are probably looking for:
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> drop table geo_test;
    drop table geo_test
    ERROR at line 1:
    ORA-00942: table or view does not exist
    test@ORA10G> drop table geo_test2;
    drop table geo_test2
    ERROR at line 1:
    ORA-00942: table or view does not exist
    test@ORA10G>
    test@ORA10G> create table geo_test (chainkey nchar(32));
    Table created.
    test@ORA10G> insert into  geo_test (chainkey) values ('a');
    1 row created.
    test@ORA10G> insert into  geo_test (chainkey) values ('');
    1 row created.
    test@ORA10G>
    test@ORA10G> create table geo_test2 (chainkey nchar(32), bla number(1), foo number(1));
    Table created.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> CREATE OR REPLACE TRIGGER geotest2_trigger
      2  BEFORE INSERT ON GEO_TEST2
      3  FOR EACH ROW
      4  DECLARE
      5    v_chainkey2  nchar(32);
      6    not_exists   EXCEPTION;
      7  BEGIN
      8    SELECT GEO_TEST.CHAINKEY INTO v_chainkey2 FROM GEO_TEST WHERE nvl(GEO_TEST.CHAINKEY,'~') = nvl(:new.chainkey,'~');
      9    IF v_chainkey2 is null THEN
    10      RAISE not_exists;
    11    END IF;
    12  EXCEPTION
    13    WHEN not_exists THEN
    14      RAISE_APPLICATION_ERROR(-20010, 'Chainkey does not exist in parent table GEO_TEST');
    15  END;
    16  /
    Trigger created.
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> insert into geo_test2 (chainkey,bla,foo) values ('b',1,1);
    insert into geo_test2 (chainkey,bla,foo) values ('b',1,1)
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "TEST.GEOTEST2_TRIGGER", line 5
    ORA-04088: error during execution of trigger 'TEST.GEOTEST2_TRIGGER'
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> insert into geo_test2 (chainkey,bla,foo) values (null,1,1);
    insert into geo_test2 (chainkey,bla,foo) values (null,1,1)
    ERROR at line 1:
    ORA-20010: Chainkey does not exist in parent table GEO_TEST
    ORA-06512: at "TEST.GEOTEST2_TRIGGER", line 11
    ORA-04088: error during execution of trigger 'TEST.GEOTEST2_TRIGGER'
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> insert into geo_test2 (chainkey,bla,foo) values ('a',1,1);
    1 row created.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G>pratz
    I think the sole purpose of that "not_exists" exception is this -
    If you try to insert a NULL value for GEO_TEST2.CHAINKEY, then this trigger will throw an error even if at least one NULL value exists in GEO_TEST.CHAINKEY column.
    Not sure if that's something that you wanted.
    Message was edited by:
    pratz

  • Bridge CC is asking my to 'purge cache'. When I do this doesn't work and freezes my mac. Bridge is unable to work at all. Please help?

    When I start up Bridge CC I get a error message instructing me to purge cache in preferences which I do but it doesn't work and freezes my mac. I cannot curretnly use Bridge CC. PLease help as this is costing me time and money - thank you in advance....

    Hold down the Option key as you launch Bridge, keep it down until you see a dialog box, then click all three options in the re-set box that comes up.
    If you don't see that re-set box, you're doing it wrong, i.e., you're not holding the Option key down fast enough.

  • Delete messages from server when deleted from iTouch doesn't work

    Hi everybody,
    Two questions really...
    One is that with my 2nd gen iTouch I was able to set IMAP settings and it would show all of the folders (other than Inbox) that I have created on my mail account. The 4th gen iTouch doesn't seem to let me see the sub-folders.
    The second is that I have my account set to delete messages from the server when they are deleted from my Inbox, but that simply doesn't work.
    This is withe the iTouch 4 and OS 4.1 (8B117)
    Any suggestions?
    Thanks

    Is it possible that I have the wrong Server Port entered? I didn't fill in that field at all. I think it was filled in automatically. I guess I would have to contact my hosting company's support team to know what the server port is.

  • When-mouse-click trigger is not working

    Hi,
    My forms version is 10g.
    I've a black level and item level when-mouse-click trigger.
    There is some code inside that which is not being executed.
    To test, i simply printed a hello message inside the trigger's code.
    Even hello is not being displayed.
    Can anyone please help me in why this trigger is not working.
    Navnit

    You have some other issues going on if you don't see anything from a when-mouse-click trigger.
    First of all, are you spelling the trigger using a dash or underscore? WHEN-MOUSE-CLICK will run, but WHEN_MOUSE_CLICK will not.
    Have you set :SYSTEM.Message_Level to some value above zero in the form? If so, set it back to zero.
    On what object are you trying to click? Is this causing navigation? Navigation may cause validation to run, which may fail, which may prevent the navigation, which may prevent your when-mouse-click from running.
    And last, are you sure you are running the currently compiled fmx version of your form?
    When nothing works, you need to back up and start finding out what DOES work first.

  • How to disable row in tabular form when checkbox checked?

    Hi.... this is what i want to do....
    I created tabular form for offering items... there is a checkbox that is used to select item with lowest price...
    But i have also one column that shows item options ( option is for example... i want offer for 22" monitor Samsung, but seller have only 22" LG monitor.... so in my offering will be shown item (22" monitor Samsung) that i want, and in row below item (22" LG monitor) that seller have... both items will have same order id....
    Next thing i want to do is when i select checkbox with item (22" LG monitor) as lowest price, i want that row with same order id (22" samsung monitor) is disabled.
    Is that possible to do?
    This is my code for creating tabular form:
    SELECT
    CASE WHEN RED_BR_OPCIJE = 0 THEN '-' ELSE TO_CHAR(RED_BR_OPCIJE) END RED_BR_OPCIJE,
    apex_item.hidden(1, ID_STAVKE)||
    apex_item.hidden(2, ID_STAVKE_IZ_ZAHTJEVA)||           ---order_id
    apex_item.hidden(3, ID_PONUDE)||
    apex_item.hidden(4, ODABIR_NAJPOVOLJNIJE_STAVKE)||     
    apex_item.checkbox(5, '#ROWNUM#', null, decode(ODABIR_NAJPOVOLJNIJE_STAVKE, 'X', '#ROWNUM#')) Odabir,    ---checkbox_lowest price
    apex_item.textarea(6, NAZIV_ARTIKLA_TRAZENO, 3, 40, 'readonly="readonly"') NAZIV_ARTIKLA_TRAZENO,
    apex_item.textarea(7, NAZIV_ARTIKLA, 3, 40, 'readonly="readonly"') NAZIV_ARTIKLA,
    apex_item.text(8, SIFRA_ARTIKLA, 8, 20, 'readonly="readonly"') SIFRA_ARTIKLA,
    apex_item.text(9, JMJ, 5, 20, 'readonly="readonly"') JMJ,
    apex_item.text(10, KOLICINA, 6, 20, 'readonly="readonly"') KOLICINA,
    apex_item.text(11, JEDINICNA_CIJENA, 12, 20, 'readonly="readonly"') JEDINICNA_CIJENA,                                      ---price
    apex_item.text(12, IZNOS_STAVKE, 12, 30, 'readonly="readonly"') IZNOS_STAVKE,
    apex_item.text(13, IZNOS_RABATA, 12, 20, 'readonly="readonly"') IZNOS_RABATA,
    apex_item.text(14, JEDINICNA_CIJENA_NAKON_POPUSTA, 12, 20, 'readonly="readonly"') JEDINICNA_CIJENA_NAKON_POPUSTA,
    apex_item.text(15, IZNOS_STAVKE_NAKON_POPUSTA, 12, 20, 'readonly="readonly"') IZNOS_STAVKE_NAKON_POPUSTA
    from PONUDE_STAVKE
    where ID_PONUDE = :P34_ID_PON
    ORDER BY ID_PONUDE ASC, ID_STAVKE_IZ_ZAHTJEVA ASC, RED_BR_OPCIJE ASC
    And this is example table with a few column names:
    order_id      option_number               item_name                      price         checkbox_lowest price
    1086                    -                Samsung 22" monitor              100$                 null                ---this row should be disabled because next row is selected as lowest price
    1086                    1                LG 22" Monitor                    90$                 X                   --- both rows have same order_id
    1050                    -                Router                            100$                X

    Hi snake2903,
    {thread:id=998140}
    {thread:id=1554583}
    {thread:id=2249233}
    Hope it helps!
    Regards,
    Kiran

  • How can I stop Firefox from automatically downloading and installing updates?????? UN-Checking box when installing for auto DOESN"T WORK!!!!

    Have many performance problems with latest versions of Firefox.
    I remove fFrefox and reinstall 18.0 and everything is fine until Firefox automatically updates to 28.x.
    I remove check in box when asked if want Firefox Maintenance installed, but downloads updates anyway and next time I bring-up then problems are back!!!
    I have to start over again and never X Firefox.
    I just want the basic Firefox - simple, FAST and WORKS !!!
    Never liked IE - but may have to go back to it.
    Chrome is also automatic download update.
    using XP, but may have to rethink
    Thanks for any help.

    What kind of problems do you have with the Firefox 28 release?
    Did you check your security software (firewall, anti-virus) to make sure that the new version in allowed?
    It is possible that your security software (firewall, anti-virus) blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full, unrestricted, access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls
    *https://support.mozilla.org/kb/fix-problems-connecting-websites-after-updating
    You can create a new profile as a test to check if your current profile is causing the problem.
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer files from a previously used profile to the new profile, but be cautious not to copy corrupted files to avoid carrying over the problem
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Adobe Flash states successful when downloaded, however it will NOT work and disappears?

    I've tried numerous time to install, uninstall and install again flash player from adobe. I go to watch a video and it still states I need to update to newest version even after doing so. I'll shut down my computer and when I turn on my computer it's gone. When I go under system preferences it's there and it shows it's sucessfully running, however, it's not. What am I doing wrong, what am I missing?

    What I'm trying to confirm is, you downloaded the Flash Player Installer, and you get a .dmg (disk image) file, on your Desktop (or wherever it was downloaded).  You double-clicked that downloaded .dmg file, to "mount" the disk image, to open a Finder window with the installer (called Install Adobe Flash Player).  You double-clicked that installer to RUN the installer app and install Flash Player.  So, just downloading the installer does not install Flash Player...  I'm trying to confirm you ran the installer after downloading it.

  • Spell Check button doesn't work anymore

    When I click on "Spell Check" button, it seems all works fine, but as soon as I click on "Change" button, or "Go back/Edit" or "Post Message", I receive the following error message :
    Your spell session has expired - please go back to the posting page to resume the spell check.
    What's the timeout on that page, few seconds ?
    Nicolas.

    Yeah, I use Firefox on my personal computer since a while, and I would have forget what's IE without being on client site which are stuck on full Microsoft product suite. Furthermore, I wouldn't have to know some IE's bugs like Re: Tags [pre] and [/pre] does no more keep blank lines. And don't know such bug is not a big missing.
    Nicolas.

  • What do I do when the rebuild function doesn't work on my email? It still saying I have 108 emails left on one of my accounts even though there are no emails being shown...

    I have Lion 10.7.5 and it says that I still have 108 emails on one of my accounts (Microsoft outlook live) even though there aren't any email being shown. And when I try to access my account on the Outlook Web App, there aren't any emails there either. I've tried the rebuild function and it doesn't do anything...what's my next move?

    Here, let me explain the way you use the word "crap" in a sentence like this, especially when I'm asking for help from a total stranger such as yourself. It's rude, obviously I know now not to do something like download something like that to my computer. It's not the difficult to figure out, and obviously I'm suffering the consequences for it now. So are you planning on helping me? Or should I not reply to your next reply if it has the word "crap" in it? I'm sure this whole discussion board was created to be used in a professional way, which is how I would like to keep my responses.

  • Hotspot Browser Icon Present But Does Not Launch When Clicked; Menu Button Doesn't Work Either When Hotspot Icon Selected

    Am very new to Blackberry.  The Curve 8900 is my wife's and she asked me to get it working on a new provider plus wifi.
    As the long subject says, the Hotspot Browser icon shows on the main menu but when I click on it nothing happens.  If I select the Hotspot Browser icon and then press the Menu key, I get kicked into the main menu. Have searched far and wide for the answer to this problem, but no luck. Most posts complaining about the Hotspot Browser are about getting a connection to the Internet.  I am not even that far -- the browser simply doesn't load.  Any help would be much appreciated.
    I have a BB email plan and wifi.  The wifi works fine for email with the mobile network turned off, so I know that my Wifi settings are fine.

    ankittvarshney wrote:
    If this is OS6.0. Try go to options> Advance settings > Browser settings> Disable browser Push!!
    I am running OS5.0.  But I already tried turning off browser push, and that's the setting on the phone now.  No luck yet.
    Thanks for your suggestion.

  • How do I install new OS when (a) DVD drive doesn't work, (b) current OS corrupt

    I've got a real conundrum.
    I've got a Mac Pro 2x2.8 server from 2008 running OS Leopard Server 5.8... I just bought the Snow Leopard Server software on CD and was going to install when two things happened. Firstly, i discovered my CD drive didn't work... and my Super Drive didn't show up either... Secondly, the current operating system has become severely corrupted, which means I can't even load up the system.
    I've tried pressing C, D, Option, Shift, Command S and Command V during startup, but not getting anywhere.
    And I can't install any new software because I can't use my DVD drive - internal or external.
    W-T-F-Do I do?
    Is there any way to transfer the Snow Leopard CD contents onto a hard drive and load via USB / Firewire?
    Bright ideas and inspired suggestions much appreciated.
    Jay

    For Leopard or Snow Leopard you need an installer DVD.
    1. You can purchase replacements for the original discs from Apple:
    Apple Store Customer Service at 1-800-676-2775 or visit online Help for more information.
    To contact product and tech support: Apple - Support - Contact Apple Support.
    2. Buy a new Snow Leopard DVD.
    You can purchase Snow Leopard through the Apple Store: Mac OS X 10.6 Snow Leopard - Apple Store (U.S.). The price is $19.99 plus tax. You will be sent physical media by mail after placing your order.
    After you install Snow Leopard you will have to download and install the Mac OS X 10.6.8 Update Combo v1.1 to update Snow Leopard to 10.6.8 and give you access to the App Store.

  • What is the problem when your camera function doesn't work and lags?

    What's the problem when the camera function doesnt work and lags? Can my iPod touch be returned because of this? I have done nothing to damage the product.

    My file association for jpg files is correct, if i click on a
    jpg, ACDSee starts immediately.Although I am a long time Windoze non-user, I vaguely remember that there's a difference between correct file-type association being set and some application starting at a mouse click on a file icon. I also vaguely remember Windoze file-type association mechanism uses a few action-types. Java Desktop should expect a specific action-type for the association.

Maybe you are looking for