INSERT within a CONTROL Block.

I have created a control block, one not based upon a table or procedure, and that block has a single item which is a BUTTON. The Button item has a WHEN_BUTTON_PRESSED trigger that contains the DML insert into table mytable values(myvalues); and a COMMIT; statement. When the button is pressed, the row is inserted, however, the message FRM-40401: No changes to save. is displayed. If I leave off the COMMIT statement, the row is not commited. How do I avoid this message?

The message you get is ONLY a message, so try this:
DECLARE
oldmsg CHAR(2); /* Old Message Level Setting */
BEGIN
oldmsg := :System.Message_Level;
:System.Message_Level := '5';
commit;
:System.Message_Level := oldmsg;
END;

Similar Messages

  • Inserting/updating data in control block based on view

    Hi!
    I`ve created a block based on a view to display data.
    I want this block to be insertable and updateable, that is I will use a on-insert/update trigger to call an insert/update procedure located in the database.
    When trying to change/insert a value in the block, the error message "Error: Can not insert into or update data in a view" pops up. I`ve tried to get rid of this error, without success.
    How can I make a data block based on a view insertable and updateable?
    My guess is that this have something to do with locking the records(there is no rowid in the view)... but I'm not sure.
    Pls advise!!

    Morten
    As well as on-update, on-insert, on-delete triggers you also need an on-lock,
    (even though it might just contain null;) otherwise the form will try to lock the view and fail.
    Actually your terminology is wrong, the block being based on a table or view is not a control block. A control block is not based on anything and has no default functionality for communicating with the database. If it was a control block, the on- triggers would not fire.

  • SOS Help!! Control Block is hitting me on my nerves....

    Hello All!
    I have a problem and id any body can solve this then i will be very thankful to her/him.
    Actually, i have four tables.One of them(studentfee) has two primary keys.(Rollono & Date)in this table the rollno is both PK & FK which reference the rollno of student table.Now problem is that i have a control block and two txt items on it. One is for Month and is used to add the date in the studentfee table and other fields will be added by mean of another data block.And that is the problem bcs the form generate the error(may be bcs other primary key is not entered).
    I think that this problem can be solved by Global variable(assigning the values to Golbal variable in the control block form
    and referencing them in the data block form)
    but this is not helping,too.Now i know
    that i am doing something wrong but couldn't grasp that one.Either i am not generating right code for Global variables OR am starting another session that is why the form is unable to get information from the global variable when i use it in the next form.
    Another question is that: Is there any way to build an .exe Or other file of my
    project which can be run and be ported to another machine(with all tables and data).
    Please, send me the answer to my email or to the oracle site and i will be very thankul to you. Bye..
    [email protected]

    Hi,
    In one block you can have items EXPLECITELLY belonging to only one DB table. You mention this table in the property palette of the block.
    If your block has items which belong to other DB table one way (but not the only way) to work around is with POST_QUERY trigger using primarykey_foreignkey (or other) relation to insert in the item the appropriate value. If there are many values we use master-detail relationships and second block.
    Do not forget before exiting the block to insert, update, delete ,etc. the changed value belonging to different tables using the PRE_INSERT, PRE_UPDATE, ... etc. triggers.
    Try to by a book explaining the Forms principles and methods.
    Keep in eye that Forms is a complex, very complex software tool. Before using them successful you have to invest time and efforts to study the basic solution methods.
    Success!
    Joseph Schwertner,
    Prof.Dr. In Computer Science

  • SQL within PL/SQL block

    This question sound funny. I just want to make sure this rule. In Oracle database before 10g, we can only use DML and transaction control code within PL/SQL block. We can not use DDL or other control languages within PL/SQL block. How about 10g? can I use DDL in PL/SQL block in 10g?
    I have created a procedure to drop all materialized view. Drop object is DDL. I used a piece of code like this:
    v_sql_stmt1 := 'DROP MATERIALIZED VIEW'||v_schema||'.'||x.mview_name;
    EXECUTE IMMEDIATE v_sql_stmt1;
    The procedure was compiled successfully. However, when I run this SP, it generate ORA-00905 missing keyword error on EXECUTE IMMEDIATE statement part. Is this caused by missing keyword in sql statement or DROP as DDL can not be used in PL/SQL block? If it is first one, what is the keyword for DROP MATERIALIZED VIEW statement?

    The versions of Oracle that run on this planet have been able to do DDL in PL/SQL for quite some time now. The DBAs who blasted off into space with you and worked in a vacuum the past however many years you feel you've been limited by this need to be replaced or re-introduced to Oracle.
    For what it's worth, the error looks like you're missing a space.

  • Populate a control Block with records at runtime

    For Example:
    For c1 in (select some_records from t1 where enam = 'SAM')
    loop
    if c1%ROWCOUNT = 1 then
    create_record;
    else
    Next_Record;
    end if;
    :Block.column1 := c1.member_no;
    :Block.column2 := c1.gender;
    :Block.column3 := c1.age;
    end loop;
    in another procedure
    GO_Item ( :Block.column1 );
    But only the last record to be inserted is showing on the block... Can someone please help? This is a control block and is not based on any table. It is also a multi record block

    I have changed the code as follows:
    For c1 in (select some_records from t1 where enam = 'SAM')
    loop
    if c1%ROWCOUNT = 1 then
    create_record;
    else
    Last_Record
    create_record;
    end if;
    :Block.column1 := c1.member_no;
    :Block.column2 := c1.gender;
    :Block.column3 := c1.age;
    end loop;
    But I can only see the last recrod that was poplated in the block, when I navigate to that block.

  • Form with a control block

    I have a form with no database block. there is only one control block with a button
    when a user presses the button I insert record into a table and then commit;
    I am getting no changes to save message. how can I avoid that.
    (setting record-status to query?) any other way?

    Change your design of logic. In the case insert and commit in procedure on the server side.
    Try to play with :system.message_level.
    Well, consider using the FORMS_DDL command, of course.

  • Buttons in a control block

    Greetings,
    I have a simple question. Do buttons in a control block automatically act on other blocks within a form or do they need to be told what block to act on.
    I have a template form that consists of a control block with a couple buttons such as save, clear and exit. My scheme is to bring in the template and introduce other blocks that write to and query the database. The buttons are not necessarily doing what they are supposed to.
    Bradley

    Hi Bradley,
    As per my understanding you need a toolbar of buttons performing generic actions (e.g COMMIT, CLEAR_RECORD)on all the blocks in a form.
    Ensure that the Mouse Navigate property of all the buttons is set to No. Otherwise, the associated code ( I am assuming all code is in WHEN-BUTTON-PRESSED)will be performed on the block the button belongs to.
    Monica

  • Change to display field on control block not reflected until form refreshed

    Hi guys, hope someone out there can help me with this query.
    I'm currently developing a form that will allow users to generate offer letters and contracts via a custom form which is used within Apps 11i. This form is a fairly standard multi-text field form with tickboxes which hold the applicant details, two buttons (one to Select All, the other to Clear All) and another button to produce the actual contracts selected.
    There is also a display field which is part of the control block attached to the form; both it and the Produce Contracts button are part of this control block. I've added a bit of code to change the text in the display field to inform the user that the contract or contracts they've requested are being generated, but although the call to the relevant code to do this appears before kicking off the concurrent request to generate the contracts, the update to the field fails to appear until after the concurrent request is complete and its output appears on another screen.
    Does anyone know why this is? I've racked my brains over it and can't seem to understand why. I've pasted the code in below if anyone has any ideas!
    Many thanks, Geoff
    --- procedure display_status_message ---
    --- Displays a status message in the request_extract_ctrl.query_information ---
    --- display item informing user what is going on ---
    --- Changes: ---
    --- G Butler 21/08/08 First version ---
    procedure display_status_message(p_tab_count in binary_integer default 0) as
    c_proc_name constant varchar2(50) := 'display_status_message';
    v_position pls_integer;
    v_msg_string varchar2(500);
    v_status_msg varchar2(2000);
    begin
         v_position := 1;
         --- go to the request_extract_ctrl block
         go_block('REQUEST_EXTRACT_CTRL');
         --- check how many records have been sent for generation
         --- get the correct message from the message dictionary
         if p_tab_count = 1 then
         fnd_message.set_name('XXJSDATA','SSL_CA_LETTER_CONTRACT_SUBMIT');
         elsif p_tab_count > 1 then
              fnd_message.set_name('XXJSDATA','SSL_CA_LETTER_CONTRACTS_SUBMIT');
         end if;
         v_position := 2;
         --- copy the message into the display item field
         v_status_msg := fnd_message.get;
         :request_extract_ctrl.query_information := v_status_msg;
         -- synchronize the change in the display item field with the form on screen
         synchronize;
         v_position := 99;
    exception
         when others then
    v_msg_string :='Unexpected error occurred in display_status_message procedure, position: '||v_position;
    v_msg_string := v_msg_string||'. SQL error: '||sqlerrm;
    fnd_message.set_string(v_msg_string);
         fnd_message.error;
         raise form_trigger_failure;
    end display_status_message;

    I had a similar problem, but it was with the message line. I found that with Web Forms, I had to issue the Synchronize; a second time, but in Client/Server Forms 6i, the first synchronize worked. Here is the code I used:
    <pre><font face = "Lucida Console, Courier New, Courier, Fixed" size = "1" color = "navy"> SYNCHRONIZE;
    if Get_Application_Property(User_Interface) = 'WEB' then
    synchronize;--first does not work on web
    end if;</font></pre>
    Let us know if this works.

  • Is it possible to update (=change) control block items in a query only form ?

    From Form.A we call Form.B with the parameter query_mode = query_only.
    This works fine.
    But in Form.B we have a non table block (=control block) with an poplist item.
    Allthough in query_only mode we like to change (it's not a real update cause it's control block) the poplist.
    But because of query_only mode this item is not updateable.
    Is there a workaround to make the poplist updateable in query_only mode ?

    Hi,
    It is not possible to change the BOX position using the Layout painter like changing windows position.
    You have change in the page Windows text elements only by changing their co ordinates.
    Regards,
    Anji

  • Sorting the data of control block in oracle form 10g

    I have two block....both are the control block..
    in first block i select the date and in second block the data of that date is populated.but the data is populated
    using cursor in when-button-pressed trigger of that first block button...
    in cursor the data is selected and placed in field of detail block using into clause.... each field..
    .and one item of detail block is srno which is create in post-query of detail block using
    :sysyem.trigger_record.
    Now i want after populated the detail block the data is sorted desc one of the field of the detail block...
    Can this possible using set_block_property() of block although the block is control block if yes where i should do
    this??????
    Please explian...????

    but with the cursor of repopulate ...how the block is in desc by one field..because if i use again the same cursor to poulate than whats this benefits???
    if i write a cursor in button when-button-trigger in first block like this code....
    go_block('');
    cursor emp_cur is
    select empno,date,sal
    from emp;
    begin
    for i in cur loop
    select i.empno,i.date,i.sal
    into :empno,:date,:sal
    from emp
    end loop
    end;
    this loop populate the block which is controll block..
    syntax error should be ignored ...i wana to explain what i want to do...
    this is not the actual query i have another query but the concept is that...
    how i can do this...

  • Control Block - Preventing creation of new record

    hi,
    i have a control block with two text fields. i do not want new record created for this block when the down key is pressed.
    How do i do that ?

    Re: data disappears when pressing down arrow key

  • How to clear a record of control block

    i have one control block with 2 items and the Max. records displayed property is set to 10.I have populated 5 records and now i want to clear one record, but the clear_record statement does not seem to be working. How to clear a record in a control block. Please help me out in this doubt of mine.

    You have probably moved focus to another block. You have to go_block and maybe go_record before using clear_block.

  • BD Adapter: Specify a dynamic amount of arguments within an "IN" block

    Hi everyone,
    Has anyone found a way to specify a dynamic amount of arguments within an "IN" block when using a custom SQL function with DB adapters?
    Like:
    SELECT Attr1 WHERE Attr2 IN #Arg1
    I don't want to use different DB adapters depending on the amount of arguments. I'd like to use the same one.
    I've tried to pass an Arg1 like this val1','val2 and it only works if Attr2 equals val1. I've also tried to enclose the #Arg1 within parenthesis but at that time the xsd seems not to know what type the #Arg1 variable should be.
    Any ideas would be great!
    Thank you,
    Guillaume

    With numbers:
    The input was "(123,1)"
    And I got this error:
    file:/c:/ora/as3/bpel/domains/processus/tmp/.bpel_PSU0101_TraiterCommunication_Enregistrement_MaJ_1.0_189aab1db75d9becb4c7f4e57a0d4352.tmp/DB_VOI1001_AGENDA_DOCUMENTS_EXPED_MaJ.wsdl [ DB_VOI1001_AGENDA_DOCUMENTS_EXPED_MaJ_ptt::DB_VOI1001_AGENDA_DOCUMENTS_EXPED_MaJ(DB_VOI1001_AGENDA_DOCUMENTS_EXPED_MaJInput_msg) ] - WSIF JCA Execute of operation 'DB_VOI1001_AGENDA_DOCUMENTS_EXPED_MaJ' failed due to: Exception Pure SQL.
    Echec de l'exécution Pure SQL de UPDATE CSST1.TOI1001_AGENDA_DOCUMENTS_EXPED SET COD_ETAT=?, DAH_ETAT=SYSDATE, COD_UTILISATEUR_MODIFICATION='SVC_INTEG', DAH_MODIFICATION=SYSDATE,NOM_CLASSEMENT_DOCUMENT=? WHERE IDE_DOCUMENT=? AND NBR_COPIES IN ?. Cause : java.sql.SQLException: ORA-01722: invalid number
    ; nested exception is:
         ORABPEL-11633
    Exception Pure SQL.
    Echec de l'exécution Pure SQL de UPDATE CSST1.TOI1001_AGENDA_DOCUMENTS_EXPED SET COD_ETAT=?, DAH_ETAT=SYSDATE, COD_UTILISATEUR_MODIFICATION='SVC_INTEG', DAH_MODIFICATION=SYSDATE,NOM_CLASSEMENT_DOCUMENT=? WHERE IDE_DOCUMENT=? AND NBR_COPIES IN ?. Cause : java.sql.SQLException: ORA-01722: invalid number
    Loption Pure SQL nest utilisée que pour les cas demploi problématiques et offre des fonctionnalités simples, mais minimes. Essayez éventuellement loption Exécuter une opération sur une table à la place.

  • Data block or control block

    any one please suggest : which is faster and better in 9i forms/reports applications, a data block with form triggers(pre,post,commit_form) for DML ; or a control block with explicit DML for retreiving and posting from/to data base.
    can PJC help in boosting performance. How ?

    Thanks but a.I find the busy dumble for a while before allowing the user to type the content in a database item (at a w/s in LAN about 900 meters away from AS). Posibly validating the item all the way to the database and back.
    b. I found certain form triggers failing e.g. pre/post update resulting erroneous enterprise data.

  • Parental controls blocks all https websites

    When I enabled parental controls for my 9-year old, I didn't expect her not to be able to use Google, Gmail and just about every single other website that requires logging in. The reason? Those websites are all https websites and parental controls blocks *ALL* https websites.
    With https becoming more and more prevalent on the web, adding an exception is not really an option anymore. I don't want to add an exception for half of the internet. It's gotten so bad that she's encountering a popup several times per minute when just doing a little research for her homework. Web filtering is apparently a whilelist only solution, suitable only for the smallest of children - the ones that you sit next to because they can't type a web address themselves, 5 years or younger.
    The only solution I could find was to turn off web filtering completely and use OpenDNS instead. Does anyone else know of a better solution?

    Hello,
    A alternative application as a option that is very worthy,
    <http://www.netnanny.com/mac>
    Randy Mac
    RMACS, LLC

Maybe you are looking for