Cursor.Open

Top  Previous  Next

Cursors are one way SQL SELECT result sets.

 

Syntax

function Cursor.Open(Connection: pointer; SelectSQL: string): pointer

 

Alternative Names

ibec_cr_OpenCursor

 

Description

Creates a new Cursor for the database connection identified by Connection for the SQL SELECT given by SelectSQL and returns this as a pointer to be used in later Cursor-routine calls.

 

See also

Cursor.Create
Cursor.Close
DB.CreateConnection

 

Example

execute UDSBlock

as

begin

  connectstr = 'database=server_fb:c:\data\testdb.fdb;username=SYSDBA;password=masterkey;

                client_library=C:\Program Files (x86)\Firebird\Firebird_4_0\fbclient.dll';

 

  /* create connection */

  FBCon = DB.CreateConnection(__ctFirebird, connectstr);

 

  /* create cursor on specific connection */

  mydata = Cursor.Open(FBCon, 'select employeeid, emp_name, salary, bonus_perc from test_data order by employeeid');

  

  try

    /* additional Cursor calls */

  finally

    Cursor.Close(mydata);

  end;

end