Re: cursors on client

From: Lawrence James <James.Lawrence_at_epamail.epa.gov>
Date: Wed, 28 Dec 1994 11:23:01 GMT
Message-ID: <James.Lawrence.89.000B628C_at_epamail.epa.gov>


In article <3dp10u$ptc_at_raffles.technet.sg> shchua_at_technet.sg (S H CHUA) writes:
>From: shchua_at_technet.sg (S H CHUA)
>Subject: cursors on client
>Date: 27 Dec 1994 12:23:58 GMT
 

>I have some questions on the use of cursors in a client-server
>environment. I am running forms 4 on hp9000(server) and 486 pc(client).
>Suppose I have a program unit in my Form that uses a cursor as follows:
 

>declare
> cursor C1 is select ...........
 

>begin
> open C1
> loop
> exit when C1%NOTFOUND
> . .......
> end loop
>end

>1) At which statement does the system retrieve the records which meet the
>select criteria from the database ( ie at the fetch, open or declare or
>....)?
>2) Are all records in the cursor selected all together or are the records
>selected one at a time?

Depends on the select statement. The use of group by, order by, for update can cause the result set to be compiled on the server at cursor open time. The rows returned from a select do not neccesarily have a 1 to 1 relationship with rows in some table. I believe the basic select from one table will not retrieve rows until the fetch occurs. I'm not totally up on the specifics of when it does what, I have just observed that it varies and it seems to take the access plan into this. Maybe someone else out there with more specific case by case info.

>3) After retrieving the records from the database on the server, are they
>placed in
>the client(pc's memory) or are they manipulated in the server's memory?

Nothing makes it to the client until you fetch, then the row you fetched goes to the client.

>Any help is appreciated.

>
>
Received on Wed Dec 28 1994 - 12:23:01 CET

Original text of this message