freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Razvan Cosma <Razvan.Cosma AT pronetis.com>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: [freetds] string cut at 78 characters?
- Date: Mon, 14 Jun 2010 16:04:51 +0300
Hello,
I have a script that should receive an e-mail in stdin, put the first lines
of its body in a string and insert it in an nvarchar(max) field. There are
no errors displayed, and the expected text does show up in the database, but
only the first 78 characters of it. Here's the code:
while (<STDIN>) {$orig .= $_; $count++; last if ($count>100 || /\w{70,}/);
chomp($orig);$orig=~s/\r//g;$orig=~s/\n/\t/g; #print STDERR $orig;
$db1 = DBI->connect("dbi:Sybase:server=$dbserver;database=$dbase;", $user,
$passwd, { syb_err_handler => \&err_handler }) || exit 1;
$st1 = $db1->prepare("insert into bounces (recipientid, documentid,
bouncecode, bouncesubject, bounceheaders) values (?,?,?,?,?)") || exit 1;
$st1->execute($recid, $docid, $msg, $subj, $orig) || exit 1;
The string, with newlines replaces by tabs, is there and the query looks
quite basic, but in the db I only get the first 78 chars for field
"bounceheaders":
>From MAILER-DAEMON Mon Jun 14 08:54:23 2010 Return-Path: <> X-Original-To:
a2@e
>From MAILER-DAEMON Mon Jun 14 08:54:24 2010 Return-Path: <> X-Original-To:
a3@e
Any hints on what goes wrong?
-
[freetds] string cut at 78 characters?,
Razvan Cosma, 06/14/2010
-
Re: [freetds] string cut at 78 characters?,
David Dick, 06/14/2010
-
Re: [freetds] string cut at 78 characters?,
Razvan Cosma, 06/15/2010
-
Re: [freetds] string cut at 78 characters?,
Razvan Cosma, 06/15/2010
-
Re: [freetds] string cut at 78 characters?,
David Dick, 06/15/2010
-
Re: [freetds] string cut at 78 characters?,
Frediano Ziglio, 06/16/2010
-
Re: [freetds] string cut at 78 characters?,
Razvan Cosma, 06/16/2010
- Re: [freetds] string cut at 78 characters?, Frediano Ziglio, 06/16/2010
- Re: [freetds] string cut at 78 characters?, Razvan Cosma, 06/17/2010
- Re: [freetds] string cut at 78 characters?, Frediano Ziglio, 06/17/2010
- Re: [freetds] string cut at 78 characters?, Razvan Cosma, 06/17/2010
-
Re: [freetds] string cut at 78 characters?,
Razvan Cosma, 06/16/2010
-
Re: [freetds] string cut at 78 characters?,
Frediano Ziglio, 06/16/2010
-
Re: [freetds] string cut at 78 characters?,
David Dick, 06/15/2010
-
Re: [freetds] string cut at 78 characters?,
Razvan Cosma, 06/15/2010
-
Re: [freetds] string cut at 78 characters?,
Razvan Cosma, 06/15/2010
-
Re: [freetds] string cut at 78 characters?,
David Dick, 06/14/2010
Archive powered by MHonArc 2.6.24.