Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2009
    Posts
    30

    Arrow Unanswered: Print Pattern in PL/SQL

    Hello All !

    I want to print following pattern

    *
    **
    ***
    ****

    How can I print the pattern ? Is the Inner loop and outer loop concept in oracle ?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Is there any job openings in oracle for freshers ??
    Not for those who do not know how answer FAQs.

    *
    **
    ***
    ****

    Can be done with either SQL or PL/SQL & is typical homework assignment.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2009
    Posts
    30

    How can I print the pattern

    Hello anacedent !

    As i said I am completely new to oracle.I am trying different things in oracle everyday. I am trying frm my side to print this pattern, bt I thought that some 1 have simple method for this that's why I asked this question.Anyways I got this from PL/SQL

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Anyways I got this from PL/SQL
    So post your solution.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Sep 2012
    Posts
    3

    Wink pattern

    Quote Originally Posted by shende.tejas View Post
    Hello All !

    I want to print following pattern

    *
    **
    ***
    ****

    How can I print the pattern ? Is the Inner loop and outer loop concept in oracle ?
    declare

    begin
    for i in 1..5
    loop
    dbms_output.put_line('');
    for j in 1..i
    loop
    dbms_output.put('*');
    end loop;
    end loop;
    end;

  6. #6
    Join Date
    Sep 2012
    Posts
    3

    Wink

    Quote Originally Posted by anacedent View Post
    >Is there any job openings in oracle for freshers ??
    Not for those who do not know how answer FAQs.

    *
    **
    ***
    ****

    Can be done with either SQL or PL/SQL & is typical homework assignment.
    declare

    begin
    for i in 1..5
    loop
    dbms_output.put_line('');
    for j in 1..i
    loop
    dbms_output.put('*');
    end loop;
    end loop;
    end;


    ------
    or
    declare

    begin
    for i in 1..6
    loop
    dbms_output.put_line('');
    for j in i..5
    loop
    dbms_output.put('*');
    end loop;
    end loop;
    end;

  7. #7
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Here's one SQL option:
    Code:
    SQL> select lpad('*', level, '*') result
      2  from dual
      3  connect by level <= 5;
    
    RESULT
    ------------------------------------------
    *
    **
    ***
    ****
    *****
    
    SQL>

  8. #8
    Join Date
    Sep 2012
    Posts
    3

    pl/sql

    nice one option ................it's very small program ,,,,,,,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •