GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Tangram::Cursor(3) User Contributed Perl Documentation Tangram::Cursor(3)

Tangram::Cursor - traverse a result set

   $cursor = $storage->cursor($remote, $filter);

   while (my $obj = $cursor->current())
   {
      # process $obj
      $cursor->next();
   }

   $cursor->execute();

   while (my $obj = $cursor->current())
   {
      # process $obj
      $cursor->next();
   }

A Cursor makes it possible to iterate over a result set without loading all the objects in memory.

See also the "limit" option to the select method of the Tangram::Storage class.

   $obj = $cursor->current();

Returns the current object, or undef() if the result set is exhausted.

   $obj = $cursor->next();
   @obj = $cursor->next();

Moves to the next object in the result set, if any. Returns the new current object, or undef() if the result set is exhausted. In list context, return all the remaining objects.

   $cursor->execute();

Moves the cursor to the first object in the result set, and return it. Note that preparing Cursors is an expensive operation, you should reuse them if possible. execute() allows just that.

execute() may be called several times in a row, or on a Cursor that has just been obtained from a Storage, without ill effects.

   my @vals = $cursor->residue();

Returns the values of the Expr that were passed to the "retrieve" directive of the Storage::select() or Storage::cursor() statement.

Each Cursor opens its own connection to the database.

Tangram::Storage
2015-10-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.