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
11,300 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
3 Comments
 
LVL 7

Expert Comment

by:Bigfam5
Comment Utility
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 34

Accepted Solution

by:
Mark Geerlings earned 500 total points
Comment Utility
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
Comment Utility
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now