PL/SQL block to check if a number is Prime

Q. Write a PL/SQL block to check weather a given number is Prime or not.


Prime number: It is a natural number greater than 1 and has no positive divisor other than 1 and itself.

For Example:
5 is prime number because, number 5 has  1 and 5 are only positive integer factors.

The following program will check weather a given number is prime or not.

       num number;
       i number:=1;
       c number:=0;
       for i in 1..num
         end if;
      end loop;
         dbms_output.put_line(num||' not a prime');
        dbms_output.put_line(num||' is prime');
     end if;


prime number