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 > PostgreSQL > select into on trigger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-25-11, 13:51
b_r_h b_r_h is offline
Registered User
 
Join Date: Mar 2011
Location: Belgium
Posts: 1
select into on trigger

Hello,

I'm new on this forum.

I have following select's on trigger, but first one is not working correctly.
Difference gets it's value ok, but key is allways null.
Code:
SELECT INTO difference EXTRACT(DAY FROM (now() - date1)), key key_id FROM orders WHERE orders.order_id = NEW.order_id;
If I split it on two, it's works ok. Difference and key has correct values.
Code:
SELECT INTO difference EXTRACT(DAY FROM (now() - date1)) FROM orders WHERE orders.order_id = NEW.order_id;

SELECT INTO key key_id FROM orders WHERE orders.order_id = NEW.order_id;
Ideas?
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