Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2009
    Posts
    2

    Red face Unanswered: pl/sql trigger...help needed

    I would like anyone who can to assist me....
    I currently have installed oracle db 10g express edition. I've got a database with 8 tables.

    I need a trigger to fire which inputs an agreed price into the total payment column in the agentpayment table when the settlement date is entered in a sales table.

    At present this is what I've doneNOT MUCH)

    create or replace trigger update_agent_payment
    after insert of settlement_date on sales
    for each row
    begin

    (I'm stuck at this point)

    anyone?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I need a trigger to fire which inputs an agreed price into the total payment column in the agentpayment table
    SQL knows nothing about "input" operation.
    SQL knows how to INPUT or UPDATE a record.
    Please clarify what the trigger needs to do.

    SEARCH of this forum or GOOGLE would likely return many, many examples of working triggers.
    Are you saying that you are unable to taking a working example & modify it to meet your requirements?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2009
    Posts
    2
    basically when the settlement date is entered in the sales table, i want the agreed price which is a column in the sales table to be placed in the total payment column in the agent payment table....and I have tried googling this but to no avail. I am at the stage before newbie?

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >i want the agreed price which is a column in the sales table to be placed in the total payment column in the agent payment table.
    SQL does not know anything about any "place" operation.
    SQL knows how to INSERT or UPDATE rows.
    Does the trigger INSERT a new row in payment table?
    Does the trigger UPDATE an existing row? If so, how to decide which row?


    Ask Tom Home
    above contains many fine coding examples.


    post DDL for tables involved with this task.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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