title: PL/SQL : i have a function but there is an error : "in a procedure,RETURN can not contain an expression"
body: <p>Here is my code:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION customer_city_function(city_in IN VARCHAR2)
  RETURN NUMBER
  AS
    number_cus NUMBER := 0;
  
    CURSOR cus_cur IS
      SELECT COUNT(*)
        FROM customer
       WHERE customer_city = city_in;
  BEGIN
    IF city_in IS NOT NULL THEN
      OPEN cus_cur;
      FETCH cus_cur INTO number_cus;
      CLOSE cus_cur;
    END IF;
  
    RETURN number_cus;
  END;
  /
  </code></pre>
  
  <p>and here is warnings:</p>
  
  <pre><code>Error starting at line : 1 in command -
  CREATE OR REPLACE FUNCTION customer_city_function(city_in IN VARCHAR2)
  RETURN NUMBER
  AS
    number_cus NUMBER := 0
  Error report -
  SQL Command: functıon CUSTOMER_CITY_FUNCTION
  Failed: Warning: executing is completed with a warning
  
  
  Error starting at line : 5 in command -
  CURSOR cur_cur IS
  Error report -
  Unknown Command
  
  
  Error starting at line : 6 in command -
  SELECT COUNT(*)
      FROM costumer
      WHERE customer_city=city_in
  Error at Command Line : 8 Column : 25
  Error report -
  SQL Error: ORA-00904: "CITY_IN": undefined variable
  00904. 00000 -  "%s: invalid identifier"
  *Cause:    
  *Action:
  
  
  Error starting at line : 9 in command -
  BEGIN
    IF city_in IS NOT NULL
    THEN
      OPEN cus_cur;
      FETCH cus_cur INTO number_cus;
      CLOSE cus_cur;
    END IF;
  RETURN (number_cus);
  END;
  
  Error report -
  ORA-06550: row 2, column 6:
  PLS-00201: 'CITY_IN' variable should been defined
  ORA-06550: row 2, column 3:
  PL/SQL: Statement ignored
  ORA-06550: row 8, column 1:
  PLS-00372: in a procedure, RETURN can not contain an expression
  ORA-06550: row 8, column 1:
  PL/SQL: Statement ignored
  06550. 00000 -  "line %s, column %s:\n%s"
  *Cause:    Usually a PL/SQL compilation error.
  *Action:
  </code></pre>
  
  <p>Where is my mistake? I can't find it, it doesn't make any sense.
  (I translated this warning message from my language. I hope I did it right.)  </p>
  
  <p>I have just tried it in Command Window and it works. Why doensn't it work in  Oracle SQL Developer sql worksheet?</p>