Loop in SQL command
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.
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.
0