Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Cannot insert record error in form

Re: Cannot insert record error in form

From: Maria J <mjenson43_at_cambridgecollege.edu>
Date: 29 Jul 2004 07:19:51 -0700
Message-ID: <8c2afc9c.0407290619.26f93b22@posting.google.com>


Anon-o-mouse <Anonomouse_at_notmail.com> wrote in message news:<t2fgg01jje0uhr12idefup0f63lr0bocq6_at_4ax.com>...
> On 27 Jul 2004 20:23:59 -0700, mjenson43_at_cambridgecollege.edu (Maria
> J) wrote:
>
> >I have a form that uses a query to access a view. I want to take 2
> -- 8< SNIP >8 --
> >Is it because I am doing this via PL/SQL and not a package? I tried
> >to create the package but have another type of error (I posted
> >earlier)
>
> I hate to be pedantic but...
> Was the exact error was FRM-40508 - Unable to insert record ?????????
>
> The following error handling should show the db error ...
> (You can either just patch it into your module OR place it in the
> on-error trigger for the form. Note if you place it in the on-error
> trigger remove the exception & when others line)
>
> DECLARE
> -- place your declares here
>
> vFormErr NUMBER;
> vDBerrNo NUMBER;
> vDBerrtext VARCHAR2(200);
> vFormtxt VARCHAR2(80);
> vErrtyp VARCHAR2(3) ;
>
> BEGIN
>
> -- place your code here
>
> EXCEPTION
> when others then
> -- put the form error no into a variable
> vFormErr := ERROR_CODE;
> IF vFormErr = 40508 THEN
> -- insert error
> -- get the database error and text
> vDBerrNo := DBMS_ERROR_CODE;
> vDBerrtext := DBMS_ERROR_TEXT;
> -- display the real problem
> Message(?ORA?||TO_CHAR(vDBerrNo)||': ' ||vDBerrtext,ACKNOWLEDGE);
> -- stop further processing
> raise Form_trigger_Failure;
> ELSE
> -- get the form messages
> vFormtxt := ERROR_TEXT;
> vErrtyp := ERROR_TYPE;
> -- show the complete form message and error
> Message(vErrtyp||?-?||TO_CHAR(vFormErr)||?: ?||vFormtxt);
> -- stop further processing
> raise Form_trigger_Failure;
> END IF;
> END;
Yes, the exact error was what I put in the subject line - thank you for the sugestion on the debug script. I am going to try it and see. Appreciate it. Received on Thu Jul 29 2004 - 09:19:51 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US