2

I am trying to write my first trigger. It is an insert trigger as follows:

<b>Fatal error</b>: postgres7 error: [-1: ERROR: INSERT has more target columns than expressions at character 78
INSERT INTO
dash_pre_queue
 (ord_obj_guid,
 ord_entry_type_guid,
 client_obj_guid, 
 installer_obj_guid, 
 installer_serial_number, 
 datetime, 
 ord_proc_state_guid,
 created,
 ord_esc_type_guid,
 in_error,
 ord_entry_guid)
SELECT
 (ord_obj_guid,
 NULL,
 client_obj_guid,
 inst_obj.inst_obj_guid,
 inst_obj.installer_serial_number,
 clock_timestamp(),
 ord_proc_state_guid,
 NULL,
 NULL,
 NULL,
 NULL)
 FROM
 ord_obj
 JOIN
 inst_obj ON inst_obj.inst_obj_guid = ord_obj.inst_obj_guid
 WHERE
 ord_obj.ord_obj_guid = NEW.ord_obj_guid

I left the error message on top. The structure of the target table matches the INSERT INTO columns. I have verified the NULL values are allowed.

If you count the columns in the Insert clause, they match the SELECT statement, yet, I get the error above stating that there is somehow a disconnect. Any ideas as to what I am doing wrong?

HLGEM
3,15318 silver badges18 bronze badges
asked Feb 8, 2013 at 14:14
1
  • just for giggles check and see if dash_pre_queue has any triggers Commented Feb 8, 2013 at 14:47

1 Answer 1

2

Remove parens around column list in select. This doesn't do what you think it does.

answered Feb 8, 2013 at 14:50
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.