title: Creating a Procedure MySQL
body: <p>Im trying to convert a procedure from using sql plus to mysql but am getting a syntax error on the third line where it says (W_IN IN NUMBER) and it has IN highlighted as the syntax error. </p>
  
  <p>SQL Plus:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE PRC_CUS_BALANCE_UPDATE (W_IN IN NUMBER) AS
  W_CUS NUMBER := 0;
  W_TOT NUMBER := 0;
  BEGIN
  -- GET THE CUS_CODE
  SELECT CUS_CODE INTO W_CUS 
  FROM INVOICE
  WHERE INVOICE.INV_NUMBER = W_IN;
  
  -- UPDATES CUSTOMER IF W_CUS &gt; 0
  IF W_CUS &gt; 0 THEN
      UPDATE CUSTOMER
      SET CUS_BALANCE = CUS_BALANCE + 
                  (SELECT INV_TOTAL FROM INVOICE WHERE INV_NUMBER = W_IN)
      WHERE CUS_CODE = W_CUS;
  END IF;
  END;
  </code></pre>
  
  <p>mySQL:</p>
  
  <pre><code>-- Trigger DDL Statements
  DELIMITER $$
  
  CREATE PROCEDURE prc_cus_balance_update (W_IN IN NUMBER) 
  AS
  W_CUS NUMBER = 0;
  W_TOT NUMBER = 0;
  BEGIN
  -- GET CUS_CODE
  SELECT CUS_CODE INTO W_CUS 
  FROM INVOICE
  WHERE INVOICE.INV_NUMBER = W_IN;
  
  -- UPDATES CUSTOMER IF W_CUS &gt; 0
  IF W_CUS &gt; 0 THEN
      UPDATE CUSTOMER
      SET CUS_BALANCE = CUS_BALANCE + 
                  (SELECT INV_TOTAL FROM INVOICE WHERE INV_NUMBER = W_IN)
      WHERE CUS_CODE = W_CUS;
  END IF;
  END $$
  
  DELIMITER ;
  </code></pre>
  
  <p>Any help is greatly appreciated!</p>