Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

print stars patterns

mo7amedApr 19 2014 — edited Apr 22 2014

created pl-sql code to print stars pattern

set serveroutput on

set verfiy off

declare

    v varchar2(250);

    num number :=&enter_rows ;

begin

    for i in 1..num loop

      v := v || ' ' || '*';

dbms_output.put_line(v);

    end loop;

    for i in reverse 0..(num-1) loop

      v := substr(v,1,i*2);

dbms_output.put_line(v);

    end loop;

end;

----------------------------------------

they are prints but on the right side

but i want to be like this ,one star then three then five AND three then one (like mirror )

             *

        *   *   *

   *   *   *   *    *

        *   *   *

            *

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 20 2014
Added on Apr 19 2014
12 comments
5,842 views