pl/sql program to print a string in a letter by letter format.
Procedure:
declare
str varchar(10):='&str';
len number(2);
i number(3):=1;
begin
len:=length(str);
while i<=len
loop
Dbms_output.put_line(substr(str,i,1));
i :=i+1;
end loop;
end;
/
Output:
SQL> @e:\plsql\9a.sql
Enter value for str: svcet
old 2: str varchar(10):='&str';
new 2: str varchar(10):='svcet';
s
v
c
e
t
PL/SQL procedure successfully completed.
Conclusion:
a pl/sql program is successfully executed for printing a string letter by letter.
Procedure:
declare
str varchar(10):='&str';
len number(2);
i number(3):=1;
begin
len:=length(str);
while i<=len
loop
Dbms_output.put_line(substr(str,i,1));
i :=i+1;
end loop;
end;
/
Output:
SQL> @e:\plsql\9a.sql
Enter value for str: svcet
old 2: str varchar(10):='&str';
new 2: str varchar(10):='svcet';
s
v
c
e
t
PL/SQL procedure successfully completed.
Conclusion:
a pl/sql program is successfully executed for printing a string letter by letter.
0 comments:
Post a Comment