Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
13,120 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 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

721 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