Multiplication trigger within a table
===

I have a table salesOrderItems:

soItemID           INT(11)         PK
salesOrderID       INT(11)
productID          INT(11)
cost               DECIMAL(7,2)
qty                TINYINT(2)
extendedCost       DECIMAL(8,2)

Via PHP, user is presented with a form to enter productID (via drop down), that selection then populates the cost field.  User then enters qty.  extendedCost is not visible on form.

What I want is a trigger that should simply auto-calculate/insert extendedCost (i.e. - multiply cost x qty) and populate extendedCost, but I'm getting 1064 errors.

Here's the trigger - what the hell am I missing???  I swear I've done this 20 times:

********************************************
DELIMITER $$

DROP TRIGGER IF EXISTS EXTENDEDCOST $$

CREATE TRIGGER EXTENDEDCOST AFTER INSERT ON salesOrderItems FOR EACH ROW BEGIN

    UPDATE salesOrderItems
    SET extendedCost = (cost * qty)
    WHERE soItemID = NEW.soItemID;
    
END $$

DELIMITER ;
*********************************************

Result:

*********************************************
ERROR 1064: 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 '-db' at line 1

SQL Statement:

USE <my db/schema>



ERROR: Error when running failback script. Details follow.



ERROR 1064: 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 '-db' at line 1

SQL Statement:

USE <my db/schema>

******************************************

I'm sure it's something stupid, but it's driving me nuts and I'm completely stuck and need extra eyes...

Thanks guys, in advance!




