Results 1 to 3 of 3

Thread: Insert error

  1. #1
    Join Date
    Aug 2010
    Posts
    21

    Unanswered: Insert error

    Hi every one . I created this trigger , but i can insert just one row information on my table
    for example when insert first time information and want to insert antoher information Db2 return error for trigger


    create trigger dec_num
    after insert on sales
    For each row mode db2sql
    UPDATE product
    SET pro_qty = pro_qty -1
    where pro_id = (select pro_id from sales)

  2. #2
    Join Date
    Jul 2006
    Location
    Bangalore
    Posts
    57
    Check below clause

    REFERENCING OLD AS OLD_TAB
    NEW AS NEW_TAB
    FOR EACH ROW MODE DB2SQL
    UPDATE product
    SET pro_qty = pro_qty -1
    where pro_id =NEW_TAB.pro_id
    Ritesh Kumar Singh
    IBM Certified DB2 DBA for LUW
    **Knowledge Is Theft If Not Shared !!**

  3. #3
    Join Date
    Aug 2010
    Posts
    21

    queastion

    hi . i don't understand this code , because I'm beginner in database

Posting Permissions

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