For the life of me, I can't see any errors in this procedure script but it claims I
have an error:
SQL 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 '; SELECT lookup_manufacturer(manufacturer) INTO _manufacturerID; '
at line 175
Can anyone see the problem?
IF (LENGTH(_subcategory) > 0) AND (_categoryID <> 0) THEN
BEGIN
SELECT lookup_category(_subcategory) INTO _subcategoryID;
IF (_subcategoryID > 0) THEN
BEGIN
SELECT add_sub_category(_categoryID, _subcategory) INTO _subcategoryID;
SELECT add_category_group(_subcategoryID);
SELECT add_category_lang(_subcategoryID, _subcategory);
END;
END;
SELECT lookup_manufacturer(manufacturer) INTO _manufacturerID;
IF (_manufacturerID = 0) AND (LENGTH(manufacturer) > 0) THEN
BEGIN
SELECT add_manufacturer(manufacturer) INTO _manufacturerID;
END;
note:
manufacturer is the value returned from the cursor, if there was a _manufacturer would be a local variable.
I am not manipulating the manufacturer at all so at the time I'm calling lookup_manufacturer, manufacturer is set to the value from the cursor and _manufacturer is not a valid local variable and is it never used.
The full procedure script is located here (748 lines):
http://www.mechanictoolsonline.com/ImportToolWeb.sql