Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL help
RJ wrote:
> Hi all,
>
> I have the follwoing table (abc):
>
> NAME NO_CASES
> --------- -------------------
>
> Smith 13
> John 9
> Mary 5
> Kate 23
>
> I want to insert into another table (xyz) as follows:
>
> Smith must be inserted 13 times (13 rows), John 9 times (9 rows) etc..
> for all the records in the table.
>
> How will I do this?
>
> Thanks in advance...
The first think you do is the following query:
SELECT keyword
FROM gv$reserved_words
WHERE keyword LIKE 'nam%';
and rename your column.
Then you write an anonymous block or stored procedure that selects the number of cases from your table and performs inserts in a FOR loop.
-- Daniel Morgan University of Washington Puget Sound Oracle Users GroupReceived on Thu Sep 28 2006 - 11:18:32 CDT
![]() |
![]() |