If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Please help! Urgent! Trigger + update

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-08-09, 21:26
kc208 kc208 is offline
Registered User
 
Join Date: Sep 2009
Posts: 5
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!
Reply With Quote
  #2 (permalink)  
Old 09-08-09, 23:54
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On