Use the following PL/SQL Procedure to reverse a string
create or replace procedure rev(x in varchar2) as
c char(1);
i number;
begin
for i in 1..length(x) loop
select substr(x,length(x)-i+1,1) into c from dual;
dbms_output.put(c);
end loop;
dbms_output.put_line(' ');
end;
/
SQL> set serverout on
SQL> exec rev('Java')
Output: avaJ
Other Most Useful PLSQL Scripts:
create or replace procedure rev(x in varchar2) as
c char(1);
i number;
begin
for i in 1..length(x) loop
select substr(x,length(x)-i+1,1) into c from dual;
dbms_output.put(c);
end loop;
dbms_output.put_line(' ');
end;
/
SQL> set serverout on
SQL> exec rev('Java')
Output: avaJ
Other Most Useful PLSQL Scripts:
- PL/SQL Function To Compute The Factorial Of A Number
- PL/SQL Function To Convert A Binary Number To A Decimal Number
- PL/SQL Function To Convert A Decimal Number To A Binary Number
- PL/SQL Function To Convert Ruppies(Numbers) In Words
- PL/SQL Function To Generate The Fibonacci Series
- PL/SQL Procedure For Counting All Tables And Respective Rows From Database
- PL/SQL Procedure To Display Monthly Calender
- PL/SQL Script To Calculate Weekdays Between Two Given Dates
COMMENTS