Cursor.Fetch

Top  Previous  Next

 

Syntax

function Cursor.Fetch(Crsr: pointer; var Values: array; FieldIndex: integer; Count: integer): boolean

 

Alternative Names

ibec_cr_Fetch

 

Description

Fetches multiple field values from cursor Crsr into the array Values. The first field value is given by the FieldIndex and from there, Count fields will be fetched into the array. If Count is NULL or zero, it will fetch data for all fields.

 

See also

Cursor.Next

 

Example

execute udsblock()

returns(r_int integer, r_varchar varchar(100), r_num numeric(15, 2))

as

begin

  /* create the cursor */

  mydata = Cursor.Create('select * from UDS$TEST_DATA');

  try

    fetched_data = null;

    while not Cursor.EOF(mydata)

    do begin

         /* fetch all fields into the array */

              Cursor.Fetch(mydata, fetched_data, 0, Cursor.FieldCount(mydata));

     

         /* fetched_data array now holds data, output some values to the script output parameters */

     r_int = fetched_data[0];

     r_varchar = fetched_data[1];

     r_num = fetched_data[5];

     suspend;

 

         Cursor.Next(mydata);

   end

  finally

    Cursor.Close(mydata);

  end        

end