Program to Reverse the given String

PROGRAM FOR REVERSING A GIVEN STRING

SQL>ED REVERSE SQL

DECLARE

L number;

I number;

S varchar2(20);

R varchar2 (20);

BEGIN

           DBMS.output.put_line (‘ENTER STRING’);

           S:= &S;

           L:= length(s);

           FOR I in reverse L..1

          Loop

          R:= r ll sub string (s, I,1);

          END LOOP          

DBMS-output.put_line (“given string;””lls);

Dbms–output.put_line(“reverse string: llr);

END;


OUTPUT:
Enter string  murthy
Given string  murthy
Reverse string   yhtrum

Related

Construction of Oracle Loops

1. ONE-WAY IF: The if commands are used for selection or decisions. Syntax: IF <condition> then ……………………….. ………………………… Statements …………………… ……………………. END IF 2.TWO WAY IF: IF the...

Program to Generate Natural Numbers

GENERATE NATURAL NUMBERS ‘n’ USING DO WHILE SQL> ED natural ‘N’ number sql DECLARE                 N number := &...

Program to Swap Two Variables without using Third Variable

PROGRAM TO SWAP TWO VARIABLES WITHOUT USING 3rd VARIABLE SQL > ED SWAP.SQL        DECLARE            A NUMBER :...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item