RyanCountry
IS-IT--Management
Trying to write a trigger that will update remote order inline, and insert a new record in gst_info_dtl for the new check seq, and populate these lines as well.
I have it updating the remote order lines in chk dtl, but inserting a new record in gst_info_dtl is giving me issues. Any ideas as to the syntax?
Thanks
Ryan
ALTER TRIGGER "Custom_Trigger_Name" BEFORE INSERT, UPDATE
ORDER 1 ON "micros"."chk_dtl"
REFERENCING NEW AS "NEW"
FOR EACH ROW
BEGIN
DECLARE @line_01 CHAR(32);
DECLARE @line_02 CHAR(32);
DECLARE @line_03 CHAR(32);
DECLARE @line_04 CHAR(32);
SELECT chk_seq FROM MICROS.chk_info_dtl where chk_seq = "NEW".chk_seq;
//SET "NEW".remote_order_device_info_line1 = @line_01;
//SET "NEW".remote_order_device_info_line2 = @line_02;
//SET "NEW".remote_order_device_info_line3 = @line_03;
//SET "NEW".remote_order_device_info_line3 = @line_04;
INSERT INTO micros.gst_info_dtl
(
chk_seq,
seat,
customer_seq,
num_guest_lines,
line_02
)
values
(
"New".chk_seq,
0,
1000001,
4,
@line_02
);
END
I have it updating the remote order lines in chk dtl, but inserting a new record in gst_info_dtl is giving me issues. Any ideas as to the syntax?
Thanks
Ryan
ALTER TRIGGER "Custom_Trigger_Name" BEFORE INSERT, UPDATE
ORDER 1 ON "micros"."chk_dtl"
REFERENCING NEW AS "NEW"
FOR EACH ROW
BEGIN
DECLARE @line_01 CHAR(32);
DECLARE @line_02 CHAR(32);
DECLARE @line_03 CHAR(32);
DECLARE @line_04 CHAR(32);
SELECT chk_seq FROM MICROS.chk_info_dtl where chk_seq = "NEW".chk_seq;
//SET "NEW".remote_order_device_info_line1 = @line_01;
//SET "NEW".remote_order_device_info_line2 = @line_02;
//SET "NEW".remote_order_device_info_line3 = @line_03;
//SET "NEW".remote_order_device_info_line3 = @line_04;
INSERT INTO micros.gst_info_dtl
(
chk_seq,
seat,
customer_seq,
num_guest_lines,
line_02
)
values
(
"New".chk_seq,
0,
1000001,
4,
@line_02
);
END