Mickautsch, Alfred wrote:
-----Ursprüngliche Nachricht-----
Von: Martin Evans [mailto:[EMAIL PROTECTED] Gesendet: Montag, 29. Januar 2007 17:25
An: [email protected]
Betreff: [EMAIL PROTECTED] - Bayesian Filter detected spam - Re: AW: CLOB Problem with DBD::ODBC/DBD::ADO for SQL Server

Martin Evans wrote:
[...]
so I'm not sure you are losing the new lines but I am sure
your losing
half of your back slashes down to Perl.

Martin
Sorry, forgot to say. The inserted text is 100001 chrs according to length in Perl and the returned chr length is 97145. I had 1486 lines containing \\\\ and got 97145 chrs back so that suggests all I lost was every \\\\ turned into \\ (i.e. no loss of line feeds).

[...]

Sorry for answering so late Martin, but we seem to have a SPAM filter
problem here :(.
Yes, I put the \\\\ there because of perl (just for this example,
in the real perl script I use bind_parameter), expecting to find \\ in
the database.
But what I get out of the database is one \ and no newline (or CRLF).

OK, Alfred, I've found a windows box with active state perl but DBI and DBD::ODBC are pretty old, DBI=1.37 and DBD::ODBC=1.05. The following script works fine (i.e. it inserts 4 \\\\, a carriage return and a line feed, 4 more \ and a carriage return and a line feed.

use DBI;
$h = DBI->connect("dbi:ODBC:XXX","xxx", "yyy");
$s = $h->prepare(q/insert into test_ntext values(?)/);
$f = <<'_EOF';
\\\\

\\\\
_EOF
$s->execute($f);

I can try getting more up to date DBI and DBD::ODBC but in the mean time:

what version of sql server are you using?
what version of the sql server odbc driver are you using?
have you got any settings in the odbc dsn changed from default?

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com

Reply via email to