Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Trigger

Status
Not open for further replies.

RyanCountry

IS-IT--Management
Apr 14, 2016
3
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top