Up Prev Next
From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: RE: more text questions
Date: Jan 26 1999 11:00PM
>>>>> "Steve" == Wechsler, Steven M writes:
Steve> Here's how I'm trying it (the CTlib option isn't available to
Steve> me as all my code uses DBLib):
Not sure what the problem is (and no time to really look), but the
following does work:
$dbh->sql("insert the_text_table(id, data) values(1, NULL)");
$dbh->dbcmd("select data from the_text_table where id = 1");
$dbh->dbwritetext('the_text_table.data', $dbh, 1, $data, TRUE);
et voilą (the TRUE is for logging to be turned on).
As you can see you can do this with only one open connection.
>> -----Original Message----- From: Michael Peppler
>> [mailto:firstname.lastname@example.org] Sent: Tuesday, January 26, 1999 4:45 PM
>> To: SybPerl Discussion List Subject: more text questions
>> >>>>> "Steve" == Wechsler, Steven M
Steve> Why do dbpreptext/dbmoretext require the buffer size to be
Steve> specified, while dbwritetext does not? The documentation is
Steve> unclear on this.
>> The $size param to dbpreptext() tells DBlib the total size of the
>> TEXT buffeer that is being sent, and the $size param to
>> dbmoretext() tells DBlib the size of the current buffer. I realize
>> now that the size param to dbwritetext() could have been omitted -
>> I could have checked it in the procedure itself.
Steve> What is the most straightforward way to write text to a text
>> The simplest way is to use a regular insert statement using Client
>> $dbh->ct_sql(qq(insert the_text values($key, "$the_text")));
>> THis works fine (modulo quote problems).
>> Otherwise calling dbwritetext() is probably the simplest, altough
>> it's by definition a two step process - you need to retrieve the
>> TEXTPTR which is done internally by dbwritetext().
>> I don't know if there is any advantage (apart from memory use) of
>> using a multi-part insert instead of writing the whole buffer in a
>> single call.
>> Michael -- Michael Peppler -||- Data Migrations Inc.
>> email@example.com -||- http://www.mbay.net/~mpeppler Int. Sybase
>> User Group -||- http://www.isug.com Sybase on Linux mailing list:
Michael Peppler -||- Data Migrations Inc.
firstname.lastname@example.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: email@example.com