Swith from query mode to insert mode

Hello I am calling a form with this
CALL_FORM('f11105.fmx', hide, do_replace, query_only, MY_LIST_PARAM);
In the New-Form-Instance of form f11105.fmx I would like to switch to from query_only mode to not_query_only mode following instructions that can only be executed in query mode.
How can I do that ?
thanks

If I use this to call my form, it will work and display the content of the block ATTRIB
CALL_FORM('f11105.fmx', hide, do_replace, query_only, VC_LIST_PARAM); but this can only be used to modify not to insert a new record
If I use this , which allows me to insert a new record, the content of the block ATTRIB is not displaying :
CALL_FORM('f11105.fmx', hide, do_replace, no_query_only, VC_LIST_PARAM);
I read in the doc that Go_Block can not be called from a trigger when Form Builder is in Insert/Query mode      so I thought that this was the reason of my problem and I was thinking that If I could swith from query_only mode to no_query_only mode
It could solve my problem . I would call the form with
CALL_FORM('f11105.fmx', hide, do_replace, query_only, VC_LIST_PARAM);
do this in the when-new-form-instance of f11105.fmb :
GO_BLOCK('ATTRIB');
EXECUTE_QUERY(ALL_RECORDS);
first_record;
and swith back to no_query_only after
What do you think? thanks
Message was edited by:
user470010

Similar Messages

  • Exiting form after being in query mode

    Hi guys,
    Having an issue with some forms after migrating from forms version 6i to 10g. Learning as I go along.
    Forms which startup in query-mode seem to have an issue when closing - all have two blocks - one block is utilised through user query and the other (like a child) displays the query results and can be updated from here. If the user does not enter a query they can cancel it using exit_form which works fine.
    After a query has been completed the system mode returns to 'normal' mode (which I can see through debugging by entering messages/pauses throughout the code). However when exiting the application breaks with error FRM-92100. I have had this problem before with regards to exiting forms but I got round this by having an open window (acting as a parent or root window) in the background which is not closable. Been tweaking the form all afternoon including using exit_form(no_validate) and other changes. By commenting out enter_query and execute_query commands the form closes as normal without issue which means it is related to query mode or something along these lines.
    If anyone has any ideas or pointers on how to move forward with this it would be much appreciated.
    Cheers,
    Robin

    Guys,
    Thanks for the replies.
    The form currently uses exit_form twice in order to close the query mode and I receive a message "query cancelled" to confirm this.
    I have also tried - and retried for the benefit of confirming this - the code you have mentioned u3 - using it in the when-window-closed trigger. I chose <option> to be no_validate.
    The main app is opened from a webpage. Forms are opened from a menu which is attached to all forms. The code that opens the forms is open_form (i.e. not call_form or new_form) for modal reasons.
    The application is disconnected straight after exit_form is used - its as if coming out of query-mode to normal causes this as I said before closes gracefully when I remove the enter_query command.
    As for the error message itself here is a fuller picture:
    FRM-92100: Your connection to the server was interrupted. This may be the result of a network error, or a failure on the Server. You will need to reestablish your session.
    Details...
    java.lang.NullPointerException
    at oracle.forms.handler.TextComponentItem.selectionChanged(Unknown Source)
    at oracle.ewt.lwAWT.lwText.LWTextComponent._fireSelectionChanged(Unknown Source)
    at oracle.ewt.lwAWT.lwText.LWTextComponent.select(Unknown Source)
    at oracle.ewt.lwAWT.lwText.LWTextField._selectAll(Unknown Source)
    at oracle.ewt.lwAWT.lwText.LWTextField.processFocusEvent(Unknown Source)
    ...AND SO ON!
    Hope this gives a better picture of what's going on :)
    Robin
    update - There is a 'dirty' workaround to this problem - if i minimize the window (change its state in any way) after the mode is back from query-mode to normal THEN close the window it closes gracefully.
    Edited by: Robin84 on Sep 10, 2008 10:03 AM

  • Update detail block based on FROM QUERY

    I have 2 blocks in master-detail relation. The master is based on a table, the detail on from query. The Insert works fine... but whenever i want to update any field from the detail block, the items (text, lists, whatever) don't allow any updating.
    Is there some workaround?
    Thank you for the help
    NR

    RTM on blocks based on from-query.
    If I recall well, it says that you shoud write the DML code in on-insert, on-update and on-delete triggers - and, anyway, if I do not remember well the manual, that's what I do.
    So, the on-insert trigger should have an insert into <my_dml_table>...
    The on-update trigger sould have an update <my_dml_table>... where ... And there's a thing: you may have the rowid of <my_dml_query> fetched - which would be the best - or use some primary key for that table for update (not so good performance).
    The on-delete trigger somewhat like the on-update trigger.
    Moreover, I believe it would be better to have procedures for on-insert, on-update and on-delete grouped in one package in the database - again, this is what I use to do.

  • How I break then insert mod and change to query mod through coding

    Hi master
    Sir how I break then insert mod and change to query mod through coding
    Please give me idea
    Aamir

    what do you mean with query-mode? QUERY-mode or ENTER-QUERY-mode ?
    QUERY-mode is after you fetch successfully data from the database
    ENTER-QUERY-mode is the mode, when you insert your selection-criteria into the record

  • How to exit from Enter-Query mode

    Hi
    I am not being able to exit from the Enter-Query mode if the result set is not returned.
    I tried to exit using ABORT_QUERY, exit_form( as we used to do in earlier version) and CTRL+Q. Nothing seems to work and I have to kill the form
    This seems to be an easy topic, but I need your help.
    Thanks in advance
    Bijay

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by bj ():
    Hi
    I am not being able to exit from the Enter-Query mode if the result set is not returned.
    I tried to exit using ABORT_QUERY, exit_form( as we used to do in earlier version) and CTRL+Q. Nothing seems to work and I have to kill the form
    This seems to be an easy topic, but I need your help.
    Thanks in advance
    Bijay<HR></BLOCKQUOTE>you maybe include a not null item,you can set the item's property
    not need .
    null

  • Frm-40208 from running in query mode. cannot change database fields

    Hi,
    Could some one help me with this.
    I am calling a form from another form. I am passing the parameter list to the calling form and doing a query by setting the block property. But when queries the message
    FRM-40208 Form running in query mode. cannot change database fields .
    I do not want the message to appear when they go the called form . Please some one could help me how could I avoid displaying the message.
    Regards
    Bain

    Hi,
    Good day! I am working with a module that also calls another form. It uses call_form with query mode parameter set to query_only. My problem is, whenever i call the other form using the call_form, it would display the called module and then as it populates the detail block of the called form, it will display frm-40208 from running in query mode. cannot change database fields per record. What I want is for the message to be displayed only once.
    I have tried capturing the error by using on-error trigger, but it doesn't go to that whenever the other form was being called. I think the message has to do with the post-query trigger, because it passes some values on a dbase block objects.
    Do you have any suggested solutions or workarounds to make the message display only once whenever the other form is being invoked by the call_form?
    I would greatly appreciate any suggestions/ideas.
    Thanks and regards,
    ASantiago

  • Blocking some fields from entering in summary block in enter query mode

    Hi ,
    I have a data block where in some fileds have to be dynamically allowed to enter and some are not based on
    a particular condition. The problem is whenever the forms enters enter query mode, all the fileds in the block are updateble. Even maually I tried to set/unset the property in forms using set_item_property, but the enter query mode was trying to overiride it and making updateble.
    Please suggest a solution for this.
    Thanks in advance.
    Thanks,
    Lohith

    Try the below code
    IF  :SYSTEM.MODE='ENTER-QUERY' THEN
    SET_BLOCK_PROPERTY('BLOCKNAME',INSERT_ALLOWED,PROPERTY_TRUE);
    SET_BLOCK_PROPERTY('BLOCKNAME',UPDATE_ALLOWED,PROPERTY_TRUE);
    SET_BLOCK_PROPERTY('BLOCKNAME',DELETE_ALLOWED,PROPERTY_TRUE);
    you can set the item here too by using the below code
    SET_ITEM_PROPERTY('BLOCK.ITEM_NAME',INSERT_ALLOWED,PROPERTY_TRUE);
    SET_ITEM_PROPERTY('BLOCK.ITEM_NAME',UPDATE_ALLOWED,PROPERTY_TRUE);Regards
    Moazam
    Edited by: Moazam Shareef on Oct 6, 2010 6:10 AM

  • Exiting from a Block that is in Enter-Query Mode

    hello,
    can anybody show me how to cancel the query of block "x" and go to block "y", when block "x" is in enter-query mode, and the user navigates using the mouse to a field in block "y".
    thanks

    Hi, Samir
    Please create the following WHEN-MOUSE-CLICK trigger in your second block.
    If you don't want to activate enter-query mode when you click on the second block, simply remove the "enter-query;" line below.
    if :system.mode = 'ENTER-QUERY' then
    declare
    oldmsg varchar2(2);
    begin
    oldmsg := :system.message_level;
    :system.message_level := '10';
    exit_form;
    :system.message_level := oldmsg;
    end;
    next_block;
    enter_query;
    end if;When the mode is ENTER-QUERY, some built-in routines change their behaviour. EXIT_FORM; is used to cancel the enter-query mode.
    Hope this helps,
    Pedro.

  • [Solved] Problem with LOV and 'enter query' mode

    Hi all,
    I'm kind of new to Forms and I'm having some problems that I'm not being able to resolve. I already search it on the net, but nothing relevant came up. If anyone could help me I appreciated it.
    In my form I have some fields, and in one of them I have a LOV, and almost everything works fine. I inserted data, changed it, deleted it and all it's ok.
    But when I change to 'enter query' mode, when I try to search for data on the LOV field it ignores what I write.
    That is, for it, it's the same if I make F11 -> write 'aaaa' -> ctrl + F11 or if I make F11 -> '%' -> ctrl + F11.
    It behaves the same way, shows me all the records.
    Probably I'm missing something basic, but I'm not getting it...
    Thanks,
    Ana

    when you create a lov by wizard the lov and record group have always the same name..
    the problem is that the item is NOT based in the tabe.
    what kind of query do you execute if you choose something from a love which is not based on the db?
    i mean, this item has no influence on the query of the table, so whatever you choose it's like a "select * from table"
    i hope i was clear

  • How to put the form in Query mode

    Hello
    Please let me know how to put the form or block in Query mode , so that when i run the form it should be in Query mode . I have seen properties of SET_FORM_PROPERTY and SET_BLOCK_PROPERTY but cannot find one
    Thanks

    QUERY mode? Did you mean, that you can only QUERY without changing data.
    This is the QUERY-ONLY-mode, which can be started e.g. call_form
    this is the help for that topic:
    PROCEDURE CALL_FORM
    (formmodule_name VARCHAR2,
    display NUMBER,
    switch_menu NUMBER,
    query_mode NUMBER,
    data_mode NUMBER,
    paramlist_name VARCHAR2);
    query_mode     
    NO_QUERY_ONLY (The default.) Form Builder will run the indicated form in normal mode, allowing the end user to perform inserts, updates, and deletes from within the called form.
    QUERY_ONLY Form Builder will run the indicated form in query-only mode, allowing the end user to query, but not to insert, update, or delete records.

  • FRM-40200 and FRM-40501 in Enter-Query-Mode

    Some strange behaviour in Enter-Query-Mode:
    Although the help states
    About Designing Forms for Querying+
    +.. To make a "query-only" block, set Query Allowed to Yes and Delete Allowed, Insert Allowed, and Update Allowed to No. ..+
    I get FRM-40200: Field is protected against update.
    System.Mode says, we are currently in ENTER-QUERY.
    Setting insert- and update-allowed to TRUE, I get
    FRM-40501: ORACLE error: unable to reserve record for update or delete.
    The entered character flashes and is erased immediately.
    Any ideas?
    Forms 10gR2
    Items are base table, all transactional properties aund query_allowed are true, query_length is ok.
    2 Things that happen before the initiation of the enter-query-mode:
    . data-source is changed to another view; column names are ok.
    . all block-items are disabled and not navigable at start-up of form and re-enabled and made navigable before entering the block.
    The values of block and item-properties mentioned above are take at WHEN-NEW-ITEM-INSTANCE and no further trigger fire.

    I think you are not meaning just the KEY-ENTQRY-Trigger, that to easy
    IF INSTR(:SYSTEM.TRIGGER_BLOCK, '_DETAIL') = 0
    +               AND :SYSTEM.TRIGGER_BLOCK NOT IN ('VZG_KOPF','KONTROLL','BUTTONS','TEMP')+
    THEN
    +     ENTER_QUERY;+
    END IF;
    .. but the rest is a lil bit, let's call it bulky; including pll and db-packageges.
    I hoped to get a clue, if somebody has a similar expeience, in what direction to search. It's strange.
    And, as I noticed today, it's not a problem of all forms of the app. Not even of all the forms called from the same "environment" (same globals, same menu-form from which they are opened). To me it looks like Enter-Query does not work in the forms where I switch the block-data-source from a view to a globally temporary table. That (this switching) is not a new feature and Enter-Query worked in the past. Althoug we had some changes in the temp tables in the last weeks there are no problems in querying the data in the forms. Recompilation of pll and fmb, no improvement. And either Enter-Query woks in a form or it does not.

  • Enter Query Mode with Block Based on Stored Procedure

    How can I get the ENTER QUERY mode to work when the data block is based on a stored procedure?

    Thank you for your review.
    Because the package is long, I stripped most of it out, but left the basics. After I stripped out the code, I ran the new code under a new user. Under the new user I built I new form, tested it, and I still cannot use the ENTER QUERY mode to retrieve the correct record. Query always returns the first record. I have included table structure and 3 test records.
    CREATE TABLE FR_Charge      
    (      FR_Charge_ID               NUMBER(8),
         FR_Charge_Code               VARCHAR2(8) CONSTRAINT FR_Charge_Code_nn NOT NULL,
         FR_Charge_Code_DESC          VARCHAR2(35),
         FR_Charge_Code_CMT          VARCHAR2(50),
              CONSTRAINT FR_Charge_pk PRIMARY KEY (FR_Charge_ID)
    CREATE SEQUENCE FR_Charge_SEQ;
    INSERT INTO FR_Charge
    VALUES(FR_Charge_SEQ.NEXTVAL,'0.0WS','E-Mail Notification', NULL);
    INSERT INTO FR_Charge
    VALUES(FR_Charge_SEQ.NEXTVAL,'0.1', 'Shipping', NULL);
    INSERT INTO FR_Charge
    VALUES(FR_Charge_SEQ.NEXTVAL,'0.12', 'Shipping Charges', NULL);
    --Package follows
    CREATE OR REPLACE PACKAGE DataCard_Pkg
    AUTHID CURRENT_USER
    AS
         -- The following records defines the data structure needed by the FR_Card.
         TYPE FR_Charge_Record IS RECORD
         (     FR_Charge_ID                    FR_Charge.FR_Charge_ID%TYPE,
              FR_Charge_Code                    FR_Charge.FR_Charge_Code%TYPE,
              FR_Charge_Code_DESC               FR_Charge.FR_Charge_Code_DESC%TYPE,
              FR_Charge_Code_CMT               FR_Charge.FR_Charge_Code_CMT%TYPE
         -- REF CURSOR definition used by the query procedure.
         TYPE FR_Charge_REFCUR IS REF CURSOR RETURN FR_Charge_Record;
         -- INDEX OF TABLES used for the DML Operation procedures.
         TYPE FR_Charge_Table IS TABLE OF FR_Charge_Record
              INDEX BY BINARY_INTEGER;
         --Define Procedure Specifications
         PROCEDURE FR_Charge_Query (DMLResultSet IN OUT FR_Charge_REFCUR);     
         PROCEDURE FR_Charge_Lock (DMLResultSet IN OUT FR_Charge_Table);
         PROCEDURE FR_Charge_Insert (DMLResultSet IN OUT FR_Charge_Table);
         PROCEDURE FR_Charge_Update (DMLResultSet IN OUT FR_Charge_Table);
         PROCEDURE FR_Charge_Delete (DMLResultSet IN OUT FR_Charge_Table);
    END DataCard_Pkg;
    CREATE OR REPLACE PACKAGE BODY DataCard_Pkg
    AS
         PROCEDURE FR_Charge_Query (DMLResultSet IN OUT FR_Charge_REFCUR)
         IS
         BEGIN
              OPEN DMLResultSet FOR
              SELECT FR_CHARGE.FR_Charge_ID,
                   FR_CHARGE.FR_Charge_Code,
                   FR_CHARGE.FR_Charge_Code_DESC,
                   FR_CHARGE.FR_Charge_Code_CMT
         FROM FR_Charge;
         END FR_Charge_Query;
         PROCEDURE FR_Charge_Lock (DMLResultSet IN OUT FR_Charge_Table)
         AS
              x_index NUMBER := 1;
              x_count NUMBER := DMLResultSet.COUNT;
              x_dummy_var VARCHAR2(1);
         BEGIN
              FOR x_index IN 1..x_count LOOP
                   SELECT 'X'
                   INTO x_dummy_var
                   FROM FR_Charge
                   WHERE FR_Charge_ID = DMLResultSet(x_index).FR_Charge_ID
                   FOR UPDATE NOWAIT;
              END LOOP;
         END FR_Charge_Lock;
         PROCEDURE FR_Charge_Insert (DMLResultSet IN OUT FR_Charge_Table)
         AS
              x_index NUMBER := 1;
              x_count NUMBER := DMLResultSet.COUNT;
         BEGIN
         FOR x_index IN 1..x_count LOOP
              INSERT INTO FR_Charge
              (      FR_Charge_ID,
                   FR_Charge_Code,
                   FR_Charge_Code_DESC,
                   FR_Charge_Code_CMT
              VALUES                               
              (     FR_Charge_SEQ.NEXTVAL,
                   UPPER(DMLResultSet(x_index).FR_Charge_Code),
                   DMLResultSet(x_index).FR_Charge_Code_DESC,
                   DMLResultSet(x_index).FR_Charge_Code_CMT
              END LOOP;
         END FR_Charge_Insert;
         PROCEDURE FR_Charge_Update (DMLResultSet IN OUT FR_Charge_Table)
         AS
              x_index NUMBER := 1;
              x_count NUMBER := DMLResultSet.Count;
         BEGIN
              FOR x_index IN 1..x_count LOOP
              UPDATE FR_Charge
                   SET FR_Charge_Code = UPPER(DMLResultSet(x_index).FR_Charge_Code),
                   FR_Charge_Code_DESC = DMLResultSet(x_index).FR_Charge_Code_DESC,
                   FR_Charge_Code_CMT = DMLResultSet(x_index).FR_Charge_Code_CMT
              WHERE FR_Charge_ID = DMLResultSet(x_index).FR_Charge_ID;
              END LOOP;
         END FR_Charge_Update;
         PROCEDURE FR_Charge_Delete (DMLResultSet IN OUT FR_Charge_Table)
         AS
              x_index NUMBER := 1;
              x_count NUMBER := DMLResultSet.Count;
         BEGIN
              FOR x_index IN 1..x_count LOOP
                   DELETE FROM FR_Charge
                   WHERE FR_Charge_ID = DMLResultSet(x_index).FR_Charge_ID;
              END LOOP;
         END FR_Charge_Delete;
    END DataCard_Pkg;

  • Enter Query mode to Normal Mode

    In my form i have a modify button. After clicking the modify mode, the mode will be enter-query. I have a number field. After entering the number i will be prompting the user to select yes or no from an alert. If he is selecting yes i will execute query modify save.. no problem.
    If he is select no.. i am populating the values from a procedure.. i want to insert a new record.. but now i want to change the enter query mode.. how do that...
    If i am using Exit_form; the populated details are getting cleared..
    please help me..

    Hi,
    Try using Abort_query. Hope it will help you.
    Regards
    Gaurav Thakur

  • What is the differences between viewCriteria query modes?

    Hello all,
    recently we faced a performance issue in a production application. after tracing  we found  that the issue was caused by setting the query mode of the view criteria to in memory.
    bussiness case description:
    when creating a new record for table A, I want to populate one field depending on records in another table B, so I used model driven LOV.
    The problem was that new records were created for both tables in the same ADF train i.e. the data for both tables were not posted or committed yet.
    so by using a query based ViewObject + viewCriteria with query mode set to memory for viewCriteria I managed to populate the LOV with the correct data,
    in another page I will show database records for table A with LOV to show meaningful messages to users ,  but I can as well create new records for table A ,but the loading of this page is very slow.
    tracing:
    using alter session set sql_trace=true; I found that table B is fully scanned and all rows are fetched-180000+ record-.
    Problem description:
    from the trace file generated found that the query issued did not have a where clause.
    also found that the viewObject fetched the entire table into memory- 180000+ record,-  then searched them in memory.
    Solution:
    changing the query mode of the viewCriteria seems to solve the issue
    so in order to avoid such issues in the future ,I wanted to make sure I understand the differences between the query modes of view criteria and their impact on the performance and if there are any differences if the viewObject is based on an entity or a sql dml.
    this is what I know so far -please correct me if I am mistaken-:
    1)database: search the database appending the conditions of the viewCriteria to whatever the query is
    2)memory: search the rows that are already in the memory.
    3)both: search both database and memory.
    also, in case I updated one of the records in the memory but did not yet post or commit will the fetched rows have the updated values? and if these changes fails the condition from the viewCriteria , will the rows be shown?.

    The camera roll contains all the photos and videos taken on your device, as well as any saved on your device from the internet, emails, text messages, etc.  The photo library contains photos synced to your device from your computer.
    Only camera roll photos are synced using iCloud with photo stream.  And photo stream only syncs photos, not videos.

  • FRM-41361 Cannot navigate out of current form in Enter-Query Mode

    Hi All,
    I am getting the FRM-41361 error in the bottom message area when opening a form from the function navigator. The issue does not exist when opening the form from the application homepage. The form is loaded in enter-query mode, and the enter_query command is in the WHEN-NEW-FORM-INSTANCE trigger. I have checked all triggers that fire after this point for any type of navigation but do not see any. The interesting thing is, if I put a fnd_message.set_string and fnd_message.show just before the enter_query call to debug, the issue goes away entirely.
    Is it possible there are security triggers firing after the form is loaded into enter-query mode that could be causing this and that the fnd_message calls are indeed buying time for those triggers to complete before the enter_query call?
    Any help/advice is appreciated. Thanks!
    Dan

    Yes, when I looked through the triggers I made sure to look for go_block and go_item calls as well as any calls to leave the form.

Maybe you are looking for

  • Passing multiple parameters in sql query

    Hi All, This may not be the correct place to post this. How to pass multiple paramters to a variable in sql developer. Ex: Select * from Country where state= :statename (Country is table name, state is column name) If I execute the above query in SQL

  • Service won't stay started!

    I'm running ZFH 5.1. The darn service that runs on the windows servers won't stay started. It will start up fine, run for about 5 minutes and then stop. In the event logs there are no entries to show errors or problems. The servers are Windows 2003 o

  • Why is my iTunes crashing on backup for my ipod?

    Problem signature:   Problem Event Name:    BEX   Application Name:    iTunes.exe   Application Version:    10.4.1.10   Application Timestamp:    4e4e1904   Fault Module Name:    StackHash_0a9e   Fault Module Version:    0.0.0.0   Fault Module Timest

  • Project Crashes While Opening

    I've been editing a project using h.264 files from Canon 5d mark iii shot at 1280x720 60p. I started by interpreting all my video files to 23.976 then started editing. The project had kept crashing over the course of editing the past two days. Today

  • 8.1, 9.1 and 10.

    Hi,           I've written a small application to monitor a JMS Queue, it was working fine, until I needed to add a webservice. I decided to use Axis2 and now the JMS Queue code no longer works:           java.lang.ClassCastException: weblogic.jms.cl