Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: j_mcallister at FirstClass dot dtint dot com (James McAllister)
Subject: dbmoretext() and only 1 db handle
Date: Jul 22 1998 11:20AM


I'm writing a program which will move large amounts of image data into a
database. Since the source file size could get quite large(10Kb - 5Mb), I
want to use dbmoretext() and move it in smaller, fixed-size chunks.

The routine I'm writing will be passed a database handle, the path of the
file to upload, the destination table name, image column name, primary key
column name, and primary key value.

Michael's example file and the Sybperl man pages show
dbwritetext() and dbmoretext() using two database handles simultaneously.
For example:

   $d2->dbwritetext ("text_table.the_text", $d, 1, "This is text which was
added with Sybperl");

My problem is that my routine won't be called immediately after dblogin(),
so I can't use dbopen() and count on the desired LOGINREC always being

I've written stuff in the past that uses the same database handle in both
places, i.e.

   $d->dbwritetext ("text_table.the_text", $d, 1, "This is text which was
added with Sybperl");.


1) Is this okay?
2) Am I courting disaster by doing it?
3) If this is a bad thing, is there an elegant way of duplicating a
database handle far downstream of the original login?
4) Anything in the works for CTlib?

Thanks in advance,

James McAllister
Digital Technology International