MySQL - Stored Proc creation in code giving syntax error
I'm baffled by the syntax error I keep getting in MYSQL (ver 5.2) when executing CREATE PROC in code.

The MySQL Proc code:

    DELIMITER //
    
    CREATE PROCEDURE Delete_BillOfMaterialsDetail
    (IN InOrderDate DATE,     
    IN InProductCode varchar(40),     
    IN InRawMaterialProductCode varchar(40) 
    ) 
    BEGIN     
    IF EXISTS
    (SELECT * FROM basf_rawmaterialplanning.BillOfMaterialsDetail          
    WHERE OrderDate = InOrderDate  
    and ProductCode = InProductCode          
    and RawMaterialProductCode = InRawMaterialProductCode)  
    THEN  
    DELETE FROM basf_rawmaterialplanning.BillOfMaterialsDetail
    WHERE OrderDate = InOrderDate    
    AND ProductCode = InProductCode
    AND RawMaterialProductCode = InRawMaterialProductCode;
    END IF; 
    END //
    
    DELIMITER ;

I build it using a string datatype then execute it against the DB which gives a syntax error.

I'm not to sure what I'm doing wrong?
MySQL - Stored Proc creation in code giving syntax error
===

I'm baffled by the syntax error I keep getting in MYSQL (ver 5.2) when executing CREATE PROC in code.

The MySQL Proc code:

    DELIMITER //
    
    CREATE PROCEDURE Delete_BillOfMaterialsDetail
    (IN InOrderDate DATE,     
    IN InProductCode varchar(40),     
    IN InRawMaterialProductCode varchar(40) 
    ) 
    BEGIN     
    IF EXISTS
    (SELECT * FROM basf_rawmaterialplanning.BillOfMaterialsDetail          
    WHERE OrderDate = InOrderDate  
    and ProductCode = InProductCode          
    and RawMaterialProductCode = InRawMaterialProductCode)  
    THEN  
    DELETE FROM basf_rawmaterialplanning.BillOfMaterialsDetail
    WHERE OrderDate = InOrderDate    
    AND ProductCode = InProductCode
    AND RawMaterialProductCode = InRawMaterialProductCode;
    END IF; 
    END //
    
    DELIMITER ;

I build it using a string datatype then execute it against the DB which gives a syntax error.

I'm not to sure what I'm doing wrong?