Solved

FRM-40735: POST-QUERY trigger raised unhandled exception ORA-00942 on a multirecord datablock form as a new user.

Posted on 2004-09-28
3
12,721 Views
Last Modified: 2008-01-09
The user that owns the tables runs the form fine with no errors but when I create a new user and grant privileges and create synonyms for the new user and then run the form as the new user I receive the following error FRM-40735: POST-QUERY trigger raised unhandled exception ORA-00942.

I have granted SELECT, INSERT, UPDATE, DELETE for the tables needed for the form to a new role I created named NETOPS_EMP. I have granted NETOPS_EMP role to my new user. I have logged in as my new user and created synonyms for the tables necessary for the form(matching table names exactly). I have sifted through my post query trigger for any line that might have schema specific path but there is none(which is good). I am kind of at a stuck point, is there any privilege I may be missing?  I have even tried granting the dba role to the new user but I still have the same error. Its gotta a be a rights/privilege issue since the form works perfectly fine as one user and gets an error as a new user.

Thanks for your help!

Ricotti
0
Comment
Question by:Ricotti
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Expert Comment

by:Bigfam5
ID: 12174100
Permission through roles can be somewhat tricky.  Try giving the permission directly to the 'new_user' and see if this resolves the error.  Also, you might try giving the REFERENCES privilege
0
 
LVL 35

Accepted Solution

by:
Mark Geerlings earned 500 total points
ID: 12174349
For best performance, you shouldn't have a post-query trigger that selects anything from the database.  Yes, this approach was required in earlier versions of Forms, but with Forms6 (and I think Forms5 also) you can base the query for the block on a view that does all of the data-gathering for you, and have the DML statements go directly to the base table, not the view used for queries.  This approach also allows you to make the "description" fields in the block queryable.

If for some reaon you don't want to make that change, Oracle Forms has a debugger that can be used to step through code line-by-line.  I always found that a pain to use though.  Here's a simpler approach: add some "message..." lines to your trigger in multiple places, then run the Form and note the last message you see.  The error will be after that.

You post-query trigger should look something like this:
begin
  message('Check 1');
  [a PL\SQL or SQL statement]
  message('Check 2');
  [another PL\SQL or SQL statement]
  message('Check 3');
  [another PL\SQL or SQL statement]
  etc.
end;

Then when you run the Form, if you see: "Check 1" and "Check 2" but not "Check 3", the error is at the SQL or PL\SQL statement between them.

Remember to remove (or comment out) the "message..." commands after you fix the problem.
0
 

Author Comment

by:Ricotti
ID: 12178998
Thank you all for the feedback! I ended up recompiling the post query trigger in the form but this time logged in as the new user and blam it pointed me to what it could not see in the database. I had accidentally created an incorrect synonym for the new user. On my original statement CREATE SYNONYM <TABLENAME> FOR <SCHEMA.OOPSWRONGTABLE>. Yeah I pointed to the wrong table for my SYNONYM. :(  Markgeer I always forget about Tableviews, that is a good suggestion which would probably cut down a little bit of the hour glassing.:) The Check1, Check2, Check3 is also a good idea, I will use this if I get really stumped on some code.

Thank you again!

Ricotti
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to recover a database from a user managed backup
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question