3 Replies Latest reply on Nov 23, 2013 5:54 PM by lake

    FRM-40350 how to find cause


      One id out of many causes FRM-40350 Query caused no records to be retrieved

      but the record is there.


      This is some kind of problem when the record is retrieved.

      I made a copy of the form and took ALL the items off it group by group eventually and it still happened. This is possibly an error in some code in some trigger.

      How can I figure out where the problem is?


      FRM-40350 is the biggest problem I ever run into with forms. It's easy to create it and really hard to find. It would be great if there was some way to debug this type of error as it is

      hugely difficult to find on a very large form.  Is there no debug technique that can find the defective code?

        • 1. Re: FRM-40350 how to find cause

          I found it!

          The procedure to find something like this is:

          copy form to a throwaway copy.

          create another unused block with one item.

          copy each form and block trigger to the unused block. Test. If it still fails, remove another one.


          If that doesn't do it,

          then do the same thing removing sections of items until you find the section with the bad item.


          So it was code in post-query block trigger, code like this:

          if :DATA.MYCODE1 is not null then
               select max(explanation) into :DATA.MYEXPL1 from code_table where code = :DATA.MYCODE1;
          end if;

          So it was retrieving a code explanation and putting it into a non-database display field on the form

          (a field that accidentally was not big enough).

          It needs to be a  lot easier to find problems like this. And in cases like this it should just give a warning it is

          truncating the value instead of just totally bombing retrieving the record.

          • 2. Re: FRM-40350 how to find cause
            Andreas Weiden

            There are two possibilities for this error (except from the one that there really is not data found):

            1. YOu have an item which only accepts specfific values (checkbox, radio-button, poplist) and none of the values of the item matches the db-value for a record

            2. Your POST-QUERY ends with an exception (which it was in your case)


            What i usually do is:

            1. Remove the POST-QUERY-trigger and try again. If the error is gone, check the POST-QUERY in mor detail

            2. Remove the poplist, checkbox and readio-button-items and try again.


            Still work to be done, but its quite fast to find the reason.

            • 3. Re: FRM-40350 how to find cause

              You were so right!

              I would really like to see forms do more to save us from ourselves accidentally creating run-time errors.  It is ever so easy to create a form with a size or type mismatch between the form and the database either with an original error or an

              error created later such as increasing the size of something in the database. So that suddenly one day the mismatch causes the form to fail.

              I'm suggesting something like the form compiler to produce a sort of spreadsheet of the form like


              form              block     type                   name                  mapping_other    db_column    db_column_type db_column_size  checked/radio_value  unchecked_value


              With radio groups it is essential to include the radio group name with radio_buttons!


              So it would analyze those pesky radio buttons and checkboxes but further also analyze sql and show what fields in

              what tables are being sent to what items or variables. I'd have to think more about this...

              at least:

              form block trigger_type trigger_name block item  type max_size  db_table db_column db_type db_column_size plsql_variable