Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Posts
    5

    Unanswered: Please help! Urgent! Trigger + update

    I Dono why the update statement keep tell me that i have multiple column,

    can any one solve this?

    really need this, is badly urgent!

    CREATE TRIGGER UPDATETOTALPRICEFORNON NO CASCADE BEFORE INSERT ON NON_MEMBER_BOOKING REFERENCING NEW AS n FOR EACH ROW MODE DB2SQL
    WHEN ((SELECT * FROM FACILITY) = N.FACIID)
    UPDATE NON_MEMBER_BOOKING SET TOTALPRICE = (SELECT FACIPUBPRICE FROM FACILITY WHERE FACIID = N.FACIID) * NUMHOUR;


    ------------------------------
    The error show me this:

    [IBM][CLI Driver][DB2/NT] SQL0412N Multiple columns are returned
    from a subquery that is allowed only one column. LINE
    NUMBER=2. SQLSTATE=42823



    Explanation:

    In the context of the SQL statement, a fullselect is specified that can
    have only one column as a result.

    The statement cannot be processed.

    User response:

    Specify only one column when only a scalar fullselect is allowed.

    sqlcode: -412

    sqlstate: 42823


    -------------------------------------

    Please help! Urgently needed!

    Your help will be appreciated!


    THANK YOU VERY VERY MUCH!

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    SELECT * FROM FACILITY returns multiple columns and it returns multiple rows.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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