title: How to get prime numbers between 1000-2000 in Oracle SQL
body: <p>This is the code I have </p>
  
  <pre><code>SET SERVEROUTPUT ON;
  DECLARE
  ACOUNTER INTEGER;
  IS_PRIME INTEGER;
  BEGIN
  IS_PRIME := 1;
  FOR NUM IN 1000..2000 LOOP
      FOR D IN 2..NUM-1 LOOP
          IF MOD(NUM,D) = 0 THEN
          IS_PRIME := 0;
          END IF;
        END LOOP; 
  END LOOP;
  
  IF IS_PRIME = 1 THEN
  ACOUNTER := ACOUNTER +1;
  
  DBMS_OUTPUT.PUT_LINE('THE # OF PRIME NUMBERS BETWEEN 1000-2000 ARE: ' || ACOUNTER);
  END;
  </code></pre>
  
  <p>I get an error:</p>
  
  <blockquote>
    <p>Error starting at line : 2 in command - Error report - ORA-06550: line
    18, column 4: PLS-00103: Encountered the symbol ";" when expecting one
    of the following:</p>
    
    <p>if
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
        END;</p>
  </blockquote>