Check whether a string is palindrome or not in PL/SQL
Prerequisite – PL/SQL introduction
In PL/SQL code groups of commands are arranged within a block. A block group related declarations or statements. In declare part, we declare variables and between begin and end part, we perform the operations.
Given a string and the task is to find whether it is Palindrome or not.
Attention reader! Don’t stop learning now. Learn SQL for interviews using SQL Course by GeeksforGeeks.
Input: str = geeksskeeg Output: geeksskeeg is palindrome Input: str = geeks Output: geeks is not palindrome
Approach is to take the string, reverse it and check whether the reversed string is equal to the original string or not. If it is equal, then it will be palindrome otherwise not.
Below is the required implementation:
abccba is palindrome