Enter / Execute Query

I have a form where a patient ID is entered in the master block. This block is related to two other detail blocks in the same form.
The user enter's a patiend ID. This ID is to be checked for validity against a ID table. Then the ID is checked against the master table to ensure a record for the patient has not already been entered. If the ID is valid and had not already been entered, the user continues in insert mode and fills in the rest of the details. If the ID record already exists, then the details of the record need to be loaded.
I have got everything working except the last part. How do I automatically switch from insert mode to execute query mode with the ID entered if it already exists in the table ?

I think it would be best to enter the ID in a control block. Master default where would be ID = :control.ID Then you can have a when-new-block-instance trigger on master:
:system.message_level := '5'; -- hides 'query caused no records'
execute_query;
:system.message_level := '0';
if :master.id is null then
:master.id := :control.id;
end if;

Similar Messages

  • Clearing Form when changing from Insert Mode to Enter/Execute Query

    Morning folks,
    I need some help or pointers with a form I am working on. At startup, the form is in Insert mode. I am using Oracle Forms 9i.
    Goal: Clear the form with NO_VALIDATE when User enters an ID in Insert mode and clicks on the Execute Query button(DEFAULT&SMARTBAR Inbuilt Menu)
    The user can do two things when they first open the screen.
    Option 1: Enter the STUDENT_ID and press Tab
    Option 2: Enter the STUDENT_ID and press the Execute Query button (Part of the DEFAULT&SMARTBAR Inbuilt Menu)
    There is a When-Validate-Item trigger on STUDENT_ID to check if the Student ID already exists in the database. If it does, it gives an Error message saying "Student ID found. Please Query the record or enter a new Student ID". This is fine with Option 1.
    The problem arises with Option 2. When I Enter a Student ID in Insert Mode and (thinking I am in Enter Query mode) and press the Execute Query button, I get two messages:
    Message 1: "Student ID found. Please Query the record or enter a new Student ID"
    Message 2: Oracle message "Do you want to save the changes? Yes/No/Cancel.
    Is there a way to stop this *Message 2?*
    Here is what I have done to try and mitigate this situation. I have created a non database field and have called it clear_form.
    In When-Validate-Item I set the field clear_form = 1 when I encounter *Message 1*
    {code}
    if t_record_exists > 0 then
    set_alert_property('ALERT_ERROR',ALERT_MESSAGE_TEXT,'Student ID found. Please Query the record or enter a new Student ID');
    alert_button := show_alert('ALERT_ERROR');
    :clear_form := 1;
    end if;
    {code}
    By creating *Key-EXEQRY* Trigger at Form Level, I was hoping that it would just clear the form. I put some messages and its seems to me that *KEY-EXEQRY* is firing first and then the *WHEN-VALIDATE-ITEM*. Is there a way to have the *WHEN-VALIDATE-ITEM* trigger fire first?
    {code}
    if :clear_form is null then
    execute_query;
    else
    clear_form(no_validate);
    end if;
    {code}
    Thanks!
    Edited by: Roxyrollers on Sep 28, 2012 8:50 AM
    Edited by: Roxyrollers on Sep 28, 2012 9:45 AM

    Having the actual Student_ID column from the table is dangerous, since it is also the key to the student's data. What if the user properly executes a query, showing a student's data, and then wants to look up another student, so keys in the new ID. If he then presses Execute Query, the Form asks "Do you want to save your changes?"
    If the user presses Yes, the new ID becomes the previous student's key.
    It would be better if you put the student_ID field in a control block. Then, the user enters a Student_ID, and presses Execute Query, the query then populates the student's data in the Base Table block. In the B_T block, the actual Student_ID column should be hidden.

  • Enter / Execute Query Anomoly in Web Forms

    Hi, I have a problem when running Oracle Forms [32 Bit] Version 6.0.8.11.3 (Production) in client server mode vs web mode.
    The problem is that the f7 (Enter Query Mode) button will put the field into enter query but when you go to type something in the field it will say that the field is protected against update even though the property on the field is not protected. I have proved this by running the same form in client server mode where is no issue.
    I have also tried running the form using the web mode button in Oracle Forms but the error still occurs. Has anyone else come across this as it is causing me a big problem.
    I have recently taken over support of an application from someone else and the form that is in the production environment does not have this issue, although it was compiled some time ago. Maybe a problem has been introduced in a newer version of forms.
    I have tried compiling my form on my PC and on the Windows 2000 server that the forms server executes on and still the same problem occurs. Any help would be much appreciated

    I have figured out what has caused this now. It is the values in the file FMRWEB.res which instruct the machine what to do when the F7 or F8 key is pressed. In fact when pressing F7 I was not going into enter query mode but was attempting to enter a new block. The keys for Enter query in default forms is F11 and CTRL F11 to Execute the query. You can overwrite the file FMRWEB.res on your local machine or server with the file FMRPCWEB.res which will give you the client server forms settings. However be aware that some of these keys may conflict with shortcut keys in your browser.

  • How to implement enter and execute query in ADF

    I am new to ADF and I am trying to create a simple data entry screen in ADF 11g based on a database table. I am looking to implement the equivalent of the Enter Query and Execute Query feature in Oracle Forms. I tried the default operations that are available with the data controls. But they don't seem to have this feature. Can someone help me / point me to how this can be implemented.
    Thanks,
    Srini.

    Thanks Shay. As per your suggestion I have included the Find and Execute buttons for the VO Object and ran the page. I first clicked the Find button and entered by query condition and then clicked the Execute button. At this point I get an error popup asking me to enter values for all the mandatory fields. Am I missing something?
    Regards,
    Srini.

  • How to implement enter-query , execute-query in Apex Forms

    Hi,
    I am new to Oracle Application Express. I want to know what is the equivalent of ENTER-QUERY and EXECUTE-QUERY features of Oracle Forms in Oracle APEX? I saw a lot of documentation, but everywhere I found that APEX forms only have 3 database actions, (1) INSERT (2) UPDATE & (3) DELETE.
    Does anybody know how we can do QUERY in APEX Forms? (like we do in Oracle Developer Forms).
    Thanks in advance.

    Oracle APEX is a web/ stateless environment. So you do not have the same functionality/ features as in a Oracle Forms environment which is session/state oriented.
    You can however achieve functionality similar to Enter Query / Execute Query through other means.
    The easiest is to use the Forms with Report wizard. It creates 2 pages, the first one is a report and the other a Form. Clicking on the Report rows takes you to the Form page in Edit mode where as the the Create button takes you to the Form in Insert mode.
    If you want to have the enter-query / execute query on a single page it will require significant effort and skills. Try it when you have acquired some more skills in Apex.
    In APEX , like any other web application, you have to think in the web paradigm and not client-server. Even Forms 11g is essentially client-server like and is session oriented through the forms applet.
    Regards,

  • Enter and execute query in ADF

    Hi Experts,
    I am trying to implement Enter-Query/Execute-Query in adf and using Jdev 11.1.2.2.0. I put Find and execute operation on the form. When i press execute button i says me to enter value for mandatory fields. But i am try to execute query not trying to create or update records. In forms we can query on any attribute.
    Please guide
    Thanks

    Enter and execute query in Oracle Forms starts with a simple row by row form for updating a table. When you press the "Enter Query" button, the form clears and the user can enter query by example criteria for any of the fields on the form. Then the user presses the "Execute Query" button, and is back in the update form, but with the data for the first matching row shown.
    Here is a page with some links to articles by Steve Muench that explains some ways to implement this in ADF 10.1.3 - I think these techniques should still work in ADF 11g:
    http://radio-weblogs.com/0118231/2006/02/13.html#a658
    Another way with ADF 11g might be to put an af:query component in one facet of an af:switcher and the update form in the other facet. The Enter Query button on the update form tells the switcher to switch to the query facet, and executing the query also tells the switcher to switch back to the update form.

  • Execute Query is not working

    hi all,
    In my when-new-form-instance form level trigger i have given go_block('blockname')
    execute_query
    but this execute query is not firing .when i checked using message i was able to reach line b4 and after the execute query but still it has not populated the data from the base table.
    the base table also contains records.
    when i run this particular fmx in the similliar but differnt database this form runs well and data gets populated automatically.
    i am unable to move fwd becouse of this i have spend many hours on this issue. please help me out.
    please write for any further clarifications..
    thanks and regards,

    There is no data on the table that satisfies the query. Copy the data from the database that does return data and try again. Are you looking at the correct table, it maybe a synonym issue as someone previously mentioned.
    A trick to see the select statement is this :- Press enter_query, enter :A into one of the query fields, press enter_query. A query box should appear. Type dog=1 and click ok. You will then get an error message (FRM-40505). Choose 'Display error' of the help menu (or Shift+F1). This will display the select statement. Obviously ignore the dog=1 as this is what caused the error but look at the where clause for clues.
    It does sound like the form is looking at at different table to you.

  • 10g Form - first execute query - very slow

    I have the following issue:
    Enter an application
    open a form in enter query mode
    first time execute query is very slow (several minutes)
    every other time it's quick (couple seconds or less)
    I can leave the form, use other forms within the app, come back and query is still quick. It's only the first time after initially launching the app.
    Any ideas what might be causing this?

    We have the same application running in 6i client/server DB-9i in production. We are testing the upgraded application that is 10g forms on OAS DB-10g. We don't have the issue in the current production client/server app.

  • Execute Query not working on custom forms

    Hi
    After upgrading from 11.5.10.2 and Oracle 9.2.0.5 to ATG6, AD6, oracle 10.2.0.4, Forms 6.0 (Form Compiler) Version 6.0.8.28.0 . The execute query (F11 & CTRL F11) is not working on custom forms. But after tabbing from one column to another column then press CTRL F11 is working.
    Please any one help me on this issue.
    Thanks
    sva

    Hi
    I found this error in the trace file. Please help me what is the problem, the data is there in the table.
    Out Argument 0 - Type: String Value: ORA-01403: no data found
    Executing NAME_IN Built-in:
    In Argument 0 - Type: String Value: parameter.G_query_find
    Out Argument 0 - Type: String Value: NULL
    Executing USER_EXIT Built-in:
    In Argument 0 - Type: String Value: FND MESSAGE_CLEAR
    MCXQPBULKINVOICEENTER, -1, Built-In, Entry, -1196178744, USER_EXIT
    TSE FSERVER_START -1 1407 1279530838565801000
    TSE FSERVER_END -1 0 1279530838579778000MCXQPBULKINVOICEENTER, -1, Built-In, Exit, -1196091744, USER_EXIT
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: Entering app_debug.clear
    In Argument 1 - Type: String Value: global.frd_debug
    Executing FIND_GROUP Built-in:
    In Argument 0 - Type: String Value: APP_DEBUG
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: Completed app_debug.free.
    In Argument 1 - Type: String Value: global.frd_debug
    Executing MESSAGE Built-in:
    In Argument 0 - Type: String Value: FRM-41003: This function cannot be performed here.
    In Argument 1 - Type: Number Value: 121
    Unhandled Exception ORA-100501
    State Delta:
    MCXQPBULKINVOICEENTER, -2, Trigger, Exit, -1190876744, ON-ERROR
    ##### CTIME STARTS HERE
    # 8 - MCXQPBULKINVOICEENTER:BLOCKNAME.RADIO_BUTTON81.1279530839956685000
    KEY Execute_query
    Error Message: FRM-41003: This function cannot be performed here.
    N-ERROR Trigger Fired:
    Form: MCXQPBULKINVOICEENTER
    State Delta:
    MCXQPBULKINVOICEENTER, -2, Trigger, Entry, 181183256, ON-ERROR
    MCXQPBULKINVOICEENTER, -1, Prog Unit, Entry, 181304256, /MCXQPBULKINVOICEENTER-3/P58_07_DEC_200909_04_40
    Executing COPY Built-in:
    In Argument 0 - Type: String Value: Entering app_standard.event. Event is ON-ERROR.
    In Argument 1 - Type: String Value: global.frd_debug
    Executing ERROR_TYPE Built-in:
    Out Argument 0 - Type: String Value: FRM
    Executing ERROR_CODE Built-in:
    Out Argument 0 - Type: Number Value: 41003
    Executing ERROR_TEXT Built-in:
    Out Argument 0 - Type: String Value: This function cannot be performed here
    Thanks
    sva

  • Execute Query problem in viewing the Image

    Hi all,
    I've created a table with the following command
    Create table test (id Number(5),img_File Blob);
    Now i've created a form, where in the I've placed two fields (id and Img_File). The data type for the Img_File field is Image Item. I'm able to see that it is getting saved.
    I've seen it using the toad that the data is being inserted into the table. When i try to press f7 and then f8(i.e.., Enter Quey, Execute Query). I'm getting the following error.
    ORA-00932: inconsistent datatypes: expected got
    My block is based on the table. I'm using Forms 6i, Windows XP. My doubt is why the error is not showing the datatype (for Ex. Expected Number got date).
    If any one has worked on the Blob, then can suggest me.
    Regards,
    Alok Dubey

    Hi,
    Thanks for your replies. I've used Long Raw data type for the image column. it started get queying.
    i've a doubt that whether it is same in Forms 6i and Forms 10g also(i.e.., Both the versions use the Long for the images). As BLob has more advantages than
    the Long raw. As this is the Oracle recommendation, I want to use Blob. Is there any work around to it.
    Regards,
    Alok Dubey

  • Execute Query - Not finding data

    I have a form with a Master-Detail-Detail (I will refer to them as Master, Detail_1, Detail_2) relationship between blocks.
    There is a WHEN_NEW_FORM_INSTANCE trigger that populates a record group and then sets a list item in Detail_1 to the record group values. All other behavior is default forms.
    When I perform an execute query using the default toolbar buttons, no data is returned even though data exists in the corresponding tables.
    I am thinking that the setting of the list item may be causing the query to fail but I'm not sure. I have commented out the working code in the WNFI trigger and just have a NULL; statement as a test, but the default query still returns no data.
    Do I need to clear the list item of its values? If so, at what point should I do this (enter-query)?
    My Forms version is 10.1.2.
    I appreciate guidance on this matter.

    The query may be failing because you are retrieving a record that has a value that is not listed in the list item's list of values. Use the list item's Mapping of Other Values property to tell Forms what to do when it retrieves a value not found in the list of values. Also see the CONVERT_OTHER_VALUE built-in.

  • Problem in Execute query on non-database block and database block together

    Hi All,
    In my form,i have
    1. First block is Non-database block with one non-database item.
    2. Second and third blocks are database blocks.
    Now the problem is that i want to perform execute-query for all the blocks.
    If the cursor is on the non-database item of 1st block and i clicks on the "Enter-query" then i am getting message " This function can not be performed here".
    If i click on the item of the database block and then clicks on the "Enter-query" and then "execute-query" it's working fine.
    But i don't want to do in this way.
    My cursor will be on the First block only and then it should perform execute-query.
    I am using this non-database item to copy value of this item to the item of the database block item.
    I think i make you understand about my problem.
    I am using forms 10g on Window xp.
    Please help me.

    Hi!
    Simply create a enter-query trigger on the non-database-block:
    begin
    go_block ( 'database_block' );
    enter_query;
    end;If your search criteria is in the non-database-item in the first block,
    you actually do not need the enter_query build-in.
    Just create a execute-query trigger on the first block like:
    begin
    go_block ( 'database_block' );
    execute_query;
    go_item ( :System.trigger_item );
    end;And in a pre-query trigger on the database-block copy the
    value of your seach item into the item you want to search for.
    Regards

  • Can execute query be controlled for blocks

    Hi,
    I've 3 blocks in my form. The first and the second block are in query mode, therefore I cannot update, insert, delete values here.
    The third block, I have put on another canvas. So the moment there's data in the second block the third block gets displayed. The user is allowed to enter values only in the third block.
    Since the first and second block are in query mode I've put the execute_query in the W-N-F-I.
    Due to the execute_query in W-N-F-I the 3rd block also starts showing me values, which it shouldn't. It should be a clear block with no values displayed.
    Mainly I want the execute_query to work only for first and second block and not for the third block.
    I tried putting the execute query in pre-block trigger. But it showing me error as Illegal operation for join condition and the forms gets hanged.
    Kindly if you could help on the same
    Thanks for your help in adv.

    I'm not sure I completely understand what you are attempting.
    I've 3 blocks in my form. The first and the second block are in query mode, therefore I cannot up date, in sert, de lete values here.So, for BLOCK1 and 2 you have set the "Query Only" property for each block item to "yes". BLOCK3 allows all DML operations.
    Since the first and second block are in query mode I've put the execute_query in the W-N-F-I.Since, these blocks are Query Only, you automatically query them in the WNFI trigger.
    Due to the execute_query in W-N-F-I the 3rd block also starts showing me values, which it shouldn't. It should be a clear block with no values displayed.Here is where I'm a little confused. Do you have a block Relationship created with BLOCK3 or do you call Execute_Query on BLOCK3 in your WNFI trigger?
    I tried putting the execute query in pre-block trigger. But it showing me error as Illegal operation for join condition and the forms gets hanged.Which data block did you try the Pre-Block trigger? By definition, the Pre-Block trigger does not allow the execution of Restricted built-ins. The Execute_Query built-in is Restricted.
    So the moment there's data in the second block the third block gets displayed. The user is allowed to enter values only in the third block.How did you implement this? What is the code you use to display BLOCK3's canvas?
    So, what happens if you have records in BLOCK3 that relate to a record in BLOCK2? How will your user know this if you start with an empty block? I've confused by the description of your requirement...
    Craig...

  • Getting error when we execute query in RSRT1

    Hi Gurus,
    I Loaded Transaction data in "0CCA_C11" cube and also loaded master data too.
    but when i execute query in RSRT1 i am getting error message
    1) Could not enter feature 0COSTCENTER__0PROFIT_CTR with SID 133 into table /BI0/SIOBJNM
    2)System error in program CL_RSR and form GET_CHANMID-02- (see long text)
    3)Error when generating dataProvider.
    For 0COSTCENTER i loaded master data but for '0PROFIT_CTR' i am unable to load Hierarchy data because still the request is yellow even showing 58 from 58 records.
    can any once can help me to soleve this issue.
    Thanks in advance.
    Raju.k
    *points to be assigned.

    Raju,
      Try replicating your hierarchy DS and reload data.
    hope it helps,
    balaji

  • Passing Parameter before execute-query?

    I want to do the following scenario, please I need help so I can do this.
    On Execute query i want a parameter to be passed.
    For Example
    I have a table of employees, and if any user executes query on employees form then before execution of query, form must first asks to give it a department name then it executes the query and of course we will get the result of that specific department.
    I hope i have made clear what i am looking to do. but i need help here.
    Thanks in advance.
    Maz

    Several ways
    May be the easiest:
    . define a non-DB Item (of apropriate type) ahead of your block to be queried,
    may be in a new non-DB-block (depends on lyout of forms
    . check on pre-query if there's a value given and abort if empty
    . define in the where clause of the block: emp.columns = :<block.crit_item>
    where crit item is the above mentioned non-DB-Item.
    More effort for the following alternative:
    . define a window
    . define a content canvas (for the new window)
    . define a non-DB-block with a non-DB-Item
    . set focus to that item on KEY-EYEQRY (assumes that key-Exeqry is called in your query process) and ask user to enter the value
    . redo query (KEY-EXEQRY on that block or add a button), this includes to set focus back to your daa block and do exe-qry there
    . set where claus in analogy to above.

Maybe you are looking for