Re: Problems with cursor in forms 4.5

From: Pierre BAR <s780406_at_student.ulg.ac.be>
Date: 1997/02/22
Message-ID: <330F24EC.1FF5_at_student.ulg.ac.be>#1/1


Srikanth Patibanda wrote:
>
> Hello,
>
> I got stucked in using cursors. Actually my problem is i got to
> retrieve more than one row from the database on to the forms 4.5 block.
>
> If i use just query (Select .... into ...from.) it is returning only
> one row and raising an error saying TOO_MANY_ROWS.
>
> so i want to use the Cursors so that i can get more than one row at a
> time. I used the following code for retrieving the data. But
> unfortunately i am able to get only one row. That too its giving the 2nd
> row in the table.
>
> Actually my problem is when an user enters the STATION_ID and
> FIRST_DATE AND LASTDATE. He should be able to retrieve the data related
> to it.
>
> DECLARE
> cursor c1 is
> select st_id, sample_date, time, compid, concentration
> from analyzed_samples1
> where st_id = :station1.st_id and
> (sample_date between :segments.firstdate and :segments.lastate);
>
>
>
> BEGIN
>
> open c1;
> loop
>
> fetch c1 into :analyzed_samples1.st_id,
> :analyzed_samples1.sample_date,
> :analyzed_samples1.time,
> :analyzed_samples1.compid,
> :analyzed_samples1.concentration;
> exit when c1%notfound;

  • You have here the information for each row !!!
    > end loop;
    >
    > close c1;
    > END;
    >
    > I really appreciate if anyone answer my question.
    >
    > Thanking you
    >
    > SRIKANTH.PATIBANDA
You must execute something in your loop : store your result in memory table or treat the information at this time. Received on Sat Feb 22 1997 - 00:00:00 CET

Original text of this message