Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL programming quesion
create or replace procedure sp_x_inserts
as
cursor get_x
is select * from the_table where x_col>1;
x number:=0;
begin
for cur_rec in get_x loop
for x in 1..cur_rec.x_col loop insert into ...... end loop;
Andre.
julie15ann_at_my-deja.com wrote:
> What logic do you use when you have a column that
> says there are X items and I want to insert the
> information on those X items into another table.
> If I did it in another programming language I
> would program it as follows:
>
> If "X items" > 1 Then
> {
> For i = 1 to "X items"
> {
> Insert A
> }
> }
>
> What I need to do is find all the columns of this
> table where X is greater than 1 and when I find
> those coulumns I would like to insert the
> information from that record X number of times
> into another table. How can I do the above using
> SQL? If you respond to this post could you also
> please reply to my email address at
> julie15ann_at_aol.com
>
> Thanks
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Received on Tue Aug 10 1999 - 23:32:10 CDT
![]() |
![]() |