Re: ASP & SQL - Very urgent please!

From: Ed prochak <ed.prochak_at_alltel.com>
Date: 19 Mar 2002 09:22:49 -0800
Message-ID: <e51b160.0203190922.766b7628_at_posting.google.com>


judithlemo_at_hotmail.com (Judith) wrote in message news:<d95531b6.0203181231.416a81fc_at_posting.google.com>...
> Hi Everybody,
>
> I have a problem with inserting records into an oracle database, could
> you please help?
> This is the error that I am getting and I have no idea what the
> problem is. Please advise!
>
> Technical Information (for support personnel)
 [long error message snipped]
>
> The line 71 that this refers to is
>
> MyConn.Execute "INSERT INTO MEMBER (memberID, membership_type,
> firstName, middleName, lastName, address, city, postcode, telephone,
> e_mail, date_of_birth, start_date, interest, objective, password,
> verify_password, paymentmethod, personal_trainer_id, membership_id)
> VALUES ('"&Request.Form("memberID")&"','"&Request.Form("membership_type")&"','"&Request.Form("firstName")&"','"&Request.Form("middleName")&"','"&Request.Form("lastName")&"','"&Request.Form("address")&"','"&Request.Form("city")&"','"&RequestForm("postcode")&"','"&Request.Form("telephone")&"','"&Request.Form("e_mail")&"','"&Request.Form("date_of_birth")&"','"&Request.Form("start_date")&"','"&Reque
 t
> Form("interest")&"','"&Request.Form("objective")&"','"&Request.Form("password")&"','"&Request.Form("verify_password")&"','"&Request.Form("Paymentmethod")&"','"&Request.Form("personal_trainer_id")&"','"&Request.Form("membership_id")&"')"
>
> I suspect the problem is with the trigger, and below is the trigger
> that I am using.
>
> create or replace trigger makeSequence
> before insert on member
> for each row
> begin
> insert into member values (NEWMEMBERSEQ.nextval, :new.MEMBERSHIP_TYPE,
> :new.FIRSTNAME, :new.MIDDLENAME, :new.LASTNAME,
> :new.ADDRESS, :new.CITY, :new.POSTCODE, :new.TELEPHONE, :new.E_MAIL,
> :new.DATE_OF_BIRTH, :new.START_DATE, :new.INTEREST,
> :new.OBJECTIVE, :new.CURRENT_LEVEL, :new.STATUS, :new.PASSWORD,
> :new.VERIFY_PASSWORD, :new.PAYMENTMETHOD, :new.PERSONAL_TRAINER_ID,
> :new.MEMBERSHIP_ID);
> end;
> /
>
> Your help will be much appreciated.
>
> Many thanks,
>
> Judith

Why do you try to INSERT again in your trigger? Your trigger only has to change the MEMBERID to the new sequence value. Remove the INSERT and add:

MEMBERID := NEWMEMBERSEQ.nextval;

Hopefully you already found this in you manual. This is a common example of what to do in a trigger.
Have a good day.

  Ed

-- 
Edward J. Prochak   --- Magic Interface, Ltd.
Ofc: 440-498-3700
on the web at       --- http://www.magicinterface.com
email: ed.prochak_at_magicinterface.com
Received on Tue Mar 19 2002 - 18:22:49 CET

Original text of this message