Cursor.Create

Top  Previous  Next

Cursors are one way SQL SELECT result sets.

 

Syntax

function Cursor.Create(SelectSQL: string): pointer

 

Description

Creates a new Cursor for the current database 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.Open
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);

 

  /* use the connection */

  DB.UseConnection(FBCon);

 

  /* create cursor on the current used connection */

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

  

  try

    /* additional Cursor calls */

  finally

    Cursor.Close(mydata);

  end;

end