PL/SQL (MOSC)

MOSC Banner

Loop in SQL command

edited Nov 27, 2011 8:03PM in PL/SQL (MOSC) 3 commentsAnswered
Hello,
I have the problem for create the PL/SQL Function to easy use in SQL command like this,,,

I have the "myTable"
create table myTable
(
  fhead  varchar2(10),
  fstart number(5,0),
  fstop  number(5,0)
);
insert into myTable values ('NA-',1,5);
insert into myTable values ('NB-',151,155);

And I want to retrieve the records by SQL command like this ..
SQL> select MyARRANGE( fhead, fstart, fstop ) as Final from myTable;
And the return result like this ...
=============
Final
=============
NA-00001
NA-00002
NA-00003
NA-00004
NA-00005
NB-00151
NB-00152
NB-00153
NB-00154
NB-00155

How can I create the PL/SQL Function for this, please suggest to me. Thank you.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center