Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004

    Unanswered: Inserting data into Tables using forms in Oracle

    hey there
    i was having a bit of trouble inserting data into tables in my oracle db.
    i tried doing what others have done and it only worked when i manually typed in the cust_id.
    i want it such that the cust_id is automatically created once the person enter's their data.

    i already have a cust_id_sequence.nextval for the cust_id field.

    i tried the following piece of code:

    insert into customer values
    (:cust_fname, :cust_surname, :cust_city,
    :cust_country, :cust_email, :cust_phone, :cust_address);
    for the register button ie When-Button-Pressed Trigger.

    the problem is that it doesn't create a cust_id for the customer.
    what can i do to solve this problem?

    Last edited by kenhitokiri; 05-23-04 at 23:17.

  2. #2
    Join Date
    Mar 2004
    Berkshire, UK
    you need a before insert trigger on the table that has somthing like

    select cust_id_sequence.nextval into :new.cust_id from dual;
    There are 10 types of people in the world, those that know Binary and those that don't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts