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,397 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle numeric condition check 4 50
PL/SQL: ORA-00979: not a GROUP BY expression 3 83
how to tune the query 17 87
Performance Issue in Oracle 3 47
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
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 configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

752 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