Re: URGENT!! FRM40508 error always.

From: <>
Date: Wed, 05 May 1999 16:02:21 GMT
Message-ID: <7gpq29$nk9$>

A couple of possibilities. 40508 reads Unable to Insert.

In one case, it was a SQL error, parent key not found, but this error did not surface to SQLCODE or SQLERRM. Instead, I needed to check DBMS_ERROR_CODE and DBMS_ERROR_TEXT to properly catch and report such a problem.

In another case, it was just as Andy Hardy had said: Nothing to Commit. I also was stuck for a few days. Forms did not see anything changed in a block so my INSERT or UPDATE statement could never get COMMITed.

Apparently, the word COMMIT is intercepted by Forms and not executed the same as a back-end, plain PL/SQL COMMIT.

We found two solutions.
1) Go through all the motions to fool Forms so that it sees "dirty" blocks, so that it makes the right choices to do the insert.

This seemed to be a big hassle, just to do something that in plain PL/SQL should be really simple. On the other hand, it preserves the synchronicity of Forms.

2) Perform the SQL statements just as you have written them, and then perform a COMMIT or ROLLBACK in the back end Oracle.

We created two stored procedures: DO_COMMIT, and DO_ROLLBACK. Create Procedure do_commit is

Then in a forms PL/SQL Block, just write normally.....and call the back end. .....Insert into xxxx (xxxxx);

A) When you do this, you are running the risk of messing up Forms' synchronicity with the database.

In our case, this was legitimate because we always exited the Form, back to a previous module which would immediate refresh there really was no risk of confusing Forms.

B) You must be certain that your code will cause "Nothing to Commit". In other words, DON'T mix and match, trying to call the COMMIT and also get into a situation where Forms will also try to perform some action, then a COMMIT. One safe way would be to clear the blocks after the back end DO_COMMIT.
   ..... SQL statement

Other than these cautions, this worked very well for us, and was very clear and concise.

Good Luck

Robert Proffitt

-----------== Posted via Deja News, The Discussion Network ==---------- Search, Read, Discuss, or Start Your Own Received on Wed May 05 1999 - 18:02:21 CEST

Original text of this message