HOW TO PRINT
*
**
***
****
*****
BY USING SQL QUERY? (MAY BE USING SCRIPT)

Answers were Sorted based on User's Feedback



HOW TO PRINT * ** *** **** ***** BY USING SQL QUERY? (MAY BE USING SCRIPT)..

Answer / kart

select lpad('*',rownum,'*') Star from person where rownum<6
*
**
***
****
*****

Is This Answer Correct ?    21 Yes 4 No

HOW TO PRINT * ** *** **** ***** BY USING SQL QUERY? (MAY BE USING SCRIPT)..

Answer / shivaindu

select lpad('*',rownum,'*') Star from dual connect by level < 6;

Is This Answer Correct ?    6 Yes 0 No

HOW TO PRINT * ** *** **** ***** BY USING SQL QUERY? (MAY BE USING SCRIPT)..

Answer / swastik

SELECT
LPAD('*',ROWNUM,'*') Stars
FROM ALL_OBJECTS
WHERE ROWNUM <= 5

Is This Answer Correct ?    3 Yes 0 No

HOW TO PRINT * ** *** **** ***** BY USING SQL QUERY? (MAY BE USING SCRIPT)..

Answer / bijaylaxmi

declare
m number:=5;
n varchar2(30);
begin
for i in 1..m
loop
for j in 1..i
loop
n:=n||'*';
end loop;
dbms_output.put_line(n);
n:=null;
end loop;
end;

Is This Answer Correct ?    2 Yes 0 No

HOW TO PRINT * ** *** **** ***** BY USING SQL QUERY? (MAY BE USING SCRIPT)..

Answer / sdsd

no need for the script

Is This Answer Correct ?    0 Yes 0 No

HOW TO PRINT * ** *** **** ***** BY USING SQL QUERY? (MAY BE USING SCRIPT)..

Answer / shrikant tyagi in nucleus soft

HOW TO PRINT * ** *** **** ***** BY USING SQL QUERY? (MAY
BE USING SCRIPT)

this is using script;


declare
type a1 is table of varchar2(100);
a a1;
b varchar2(100);
begin
select lpad('*',rownum,'*') bulk collect into a from
lea_agreement_dtl where rownum < 5;
for i in 1..a.count
loop
b:=b||' '||a(i);
end loop;
dbms_output.put_line(b);
end;

Is This Answer Correct ?    0 Yes 0 No

HOW TO PRINT * ** *** **** ***** BY USING SQL QUERY? (MAY BE USING SCRIPT)..

Answer / s m nadeem

Declare
type stars is table of varchar2(10);
v_star stars;
v_str varchar2(10);

Begin
select lpad('*', rownum, '*')
bulk collect
into v_star
from tab_star
where rownum < 6;

for i in 1 .. v_star.count loop
v_str := v_star(i);
dbms_output.put_line(v_str);
End loop;
End;

Is This Answer Correct ?    0 Yes 0 No

HOW TO PRINT * ** *** **** ***** BY USING SQL QUERY? (MAY BE USING SCRIPT)..

Answer / shrikant tyagi

HOW TO PRINT * ** *** **** ***** BY USING SQL QUERY? (MAY
BE USING SCRIPT)

this is using script;


declare
type a1 is table of varchar2(100);
a a1;
b varchar2(100);
begin
select lpad('*',rownum,'*') bulk collect into a from
lea_agreement_dtl where rownum < 5;
for i in 1..a.count
loop
b:=b||' '||a(i);
end loop;
dbms_output.put_line(b);
end;

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

what is the stuff function and how does it differ from the replace function? : Sql dba

0 Answers  


Can we join 3 tables in sql?

0 Answers  


what is a table called, if it has neither cluster nor non-cluster index? What is it used for? : Sql dba

0 Answers  


What version is sql?

0 Answers  


What are the two different parts of the pl/sql packages?

0 Answers  






what are the advantages of using stored procedures? : Sql dba

0 Answers  


I have a small PL/SQL Block assume in this way begin select * from emp where empno=100; exception when others then <Some Messages> when no_data_found then <Some Messages> when too_many_rows then <Some Messages> end; The question which he asked was whether this block will get executed normally or it will throw error ? If errored out then what is the reason for the error ? Could anybody please help me ? Regards Nakul Venkataraman

3 Answers   Satyam,


Why do we need pl sql?

0 Answers  


Why indexing is needed?

0 Answers  


What is Difference Between Unique and Primary Key Constraints?

0 Answers   Wipro,


What is the need of merge statement?

0 Answers  


What is not in sql?

0 Answers  


Categories