PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: BLK API for DBD::Sybase...
Date: Jul 9 2004 2:15PM

... is starting to take shape in my copy of DBD::Sybase.

I'd like some input for the $h->commit call implementation.

To commit a bunch of rows submitted with the BLK api (in C) you call
	blk_done(blk_desc, type, &rows);
where blk_desc is the BLK descriptor, type is one of CS_BLK_BATCH
(commit this batch, there are more rows comming), CS_BLK_ALL (commit
this batch, this is the last batch) or CS_BLK_CANCEL (rollback this
batch). The number of rows actually committed is returned in "rows".

$h->commit() maps pretty nicely to blk_done(CS_BLK_BATCH), rollback to
CS_BLK_CANCEL, and finish() to CS_BLK_ALL. However, what do I do with
the row count?

The way I see it I have two choices:

1. Store the rowcount somewhere (e.g. $sth->{syb_bcp_rows_affected})
or
2. Don't use commit/rollback/finish, and instead create an ad-hoc
private method ($sth->syb_bcp_commit(\$rows), etc).

Other ideas?

Other comments?

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
mpeppler@peppler.org                       http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short
or long term contract positions - http://www.peppler.org/resume.html