CREATE PRODECURE prc_inv_amounts
@inv_num DECIMAL
BEGIN
UPDATE INVOICE SET
INV_SUBTOTAL = (SELECT SUM(LINE_TOTAL) FROM LINE WHERE INV_NUMBER = @inv_num),
INV_TAX = INV_SUBTOTAL * 0.8,
INV_TOTAL = INV_SUBTOTAL + INV_TAX
WHERE INV_NUMBER = @inv_num
END
Error:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PRODECURE prc_inv_amounts @inv_num DECIMAL BEGIN UPDATE INVOICE SET INV_SUBTOTAL' at line 1