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: Insert problem using a submit button

Re: Insert problem using a submit button

From: Carlene <carlene_at_tobedebtfree.com>
Date: 13 Apr 2003 12:34:16 -0700
Message-ID: <175fc98c.0304131134.204ae212@posting.google.com>


What we have is form level trigger, there is currently no trigger in the database:

INSERT into members
values (:members.user_id, :members.passwd, etc..); commit;

user_id is a primary key that is a varchar2 created by the user and it is creating 2 records(we found this out after we got the error that the primary key is being violated and we took the primary key constraint off the record). Is this because when you hit the submit button it says any changes made to the current form to the backend-therefore creating two records?

is it necessary to have a backend trigger as well as on the frontend? Or do we need to call the backend trigger from the front end?

Thanks in advance for any help!

-Carlene

Frank <fvanbortel_at_netscape.net> wrote in message news:<3E99623A.6020304_at_netscape.net>...
> Karsten Farrell wrote:
> > carlene_at_tobedebtfree.com said...
> >
> >>I have created a form in Oracle 9i that inserts a record into a
> >>database. When I click save, it works fine. So I made a submit
> >>button with a when_button_pushed trigger. the code is
> >>Insert into members values(:members.user_id, etc.)-im positive the
> >>code is right! When i run this code i get a error that states my
> >>primary key constraint is prohibiting me from inserting. So I took
> >>off the constraint, and found that it was inserting two records at the
> >>same time. Does anyone know why this is happening, and if so can you
> >>PLEASE tell me how to fix it.
> >>
> >>Thanks!
> >>
> >
> > If your code isn't doing it, then it sounds suspiciously like a database
> > trigger being fired. Try:
> >
> > select trigger_name from all_triggers
> > where table_name = 'MEMBERS';
>
> that, or you do not post all of your code... is there a commit, too?
> Then that's the answer - you already inserted (forms did...), and you
> insert again. Actually, all you need is a commit_form;
Received on Sun Apr 13 2003 - 14:34:16 CDT

Original text of this message

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