DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Help Inserting data into database through ORACLE Forms 6

Hybrid View

  1. #1
    Join Date
    May 2000
    Location
    Greenbelt, MD, USA
    Posts
    22

    Angry

    Hi THere,
    I am trying to insert data into an oracle database through a form I am creating. The questions I have are as follows:

    - at what level should I put the trigger that does the insert. At the moment I created an insert at the button level with the "when-button-pressed" trigger, but it does not work. It freezes up when I press the insert when I run it.

    - The "ID" column which is my primary key as only the basic constraints like NOT NULL. How can I icrement it upon insert? I am supposed to have a pre-insert trigger? at what level?

    - I have a primary key that is to be incremented and therefore I created a sequence. I am ommitingthe primary key in the insert. Am I supposed to have another trigger somewhere to increment the ID value??


    Thanks
    Dee.
    God Bless

  2. #2
    Join Date
    Jul 2000
    Posts
    296
    If you have a base table item, Oracle (or Forms) generates SQL at runtime to insert, update, delete and query rows in the base table, based upon user's actions. You don't need to write code for the insert.

    With a PRE-INSERT trigger you can assign IDs based on sequences. Set INSERT ALLOWED and NAVIGABLE on FALSE for the item, to prevent entering IDs manually.

    SELECT your_sequence.nextval
    INTO :block.item
    FROM sys.dual;



  3. #3
    Join Date
    Aug 2000
    Location
    Ny
    Posts
    105
    First, why don’t you create a sequence and a pre IUD trigger on the tables on the database side, I think it’s more efficient and easier to maintain.

  4. #4
    Join Date
    May 2000
    Location
    Greenbelt, MD, USA
    Posts
    22
    Thanks for your help guys.... I used the latter suggestion and created a pre inset trigger onthe databse table. I will look into the other suggestion. Thanks once again.
    Dee..
    God Bless

Posting Permissions

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


Click Here to Expand Forum to Full Width