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 dbtext.pl and the Sybperl man pages show
dbwritetext() and dbmoretext() using two database handles simultaneously.
$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
$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,
Digital Technology International