DECLARE str varchar2(50):='&string';
counter int:=length(str);
BEGIN dbms_output.put_line(counter);
LOOP exit WHEN counter=0;
exit WHEN not(substr(str,counter,1)=substr(str,((length(str)+1)-counter),1));
counter:=counter-1;
END LOOP;
IF counter=0 THEN dbms_output.put_line(str||'is palindrom');
ELSE dbms_output.put_line(str||'is not palindrom');
END IF;
END;
/