PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation’s procedural extension for SQL and the Oracle relational database. It is one of three key programming languages which is only available in Oracle Database.
Copy the below PL/SQL program and execute it. In this program, we are going to share a Pl/SQL program for palindrome number with the output.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | declare n number; m number; rev number:=0; r number; begin n:=12321; m:=n; while n>0 loop r:=mod(n,10); rev:=(rev*10)+r; n:=trunc(n/10); end loop; if m=rev then dbms_output.put_line('number is palindrome'); else dbms_output.put_line('number is not palindrome'); end if; end; / |
number is palindrome
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.