pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
libpqxx: Cursors needed??!
2+ messages / 2 participants
[nested] [flat]

* libpqxx: Cursors needed??!
@ 2003-01-15 22:51  Key88 SF <key88sf@hotmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Key88 SF @ 2003-01-15 22:51 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: jtv@xs4all.nl


It's not clear to me when to use the Cursor class, if at all. Transactions 
seem to execute fine and I get valid Result classes back without using 
cursors. Many of the sample programs don't use them either.

Are cursors needed at all??

-Dave


_________________________________________________________________
Help STOP SPAM: Try the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: libpqxx: Cursors needed??!
@ 2003-01-19 14:17  Jeroen T. Vermeulen <jtv@xs4all.nl>
  parent: Key88 SF <key88sf@hotmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Jeroen T. Vermeulen @ 2003-01-19 14:17 UTC (permalink / raw)
  To: Key88 SF <key88sf@hotmail.com>; +Cc: pgsql-interfaces

On Wed, Jan 15, 2003 at 10:51:22PM +0000, Key88 SF wrote:
> 
> It's not clear to me when to use the Cursor class, if at all. Transactions 
> seem to execute fine and I get valid Result classes back without using 
> cursors. 

There's no special reason why you should use Cursor to retrieve
results--you can always just call TransactionItf::Exec() and get
Results from that.  Use Cursor only when you want to create an
SQL cursor.

 
> Many of the sample programs don't use them either.
 
The sample programs were mostly written in the order in which they're
numbered, so some of them predate cursors.


> Are cursors needed at all??

No.  It's a convenience class; you can always just execute the
cursor-related commands by hand.  The wrapper class just gives you
conveniences like additional compiler checking, more specific error
messages, more user-friendly syntax, and absolute positioning.  The
latter may be a little harder to do for yourself than it seems,
because of the way postgres returns tuple counts when moving or
fetching with a cursor.


Jeroen




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-01-19 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-15 22:51 libpqxx: Cursors needed??! Key88 SF <key88sf@hotmail.com>
2003-01-19 14:17 ` Jeroen T. Vermeulen <jtv@xs4all.nl>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox