AW: Re: AW: CLOB Problem with DBD::ODBC/DBD::ADO for SQL Server

AW: Re: AW: CLOB Problem with DBD::ODBC/DBD::ADO for SQL Server

am 30.01.2007 10:02:53 von alfred.mickautsch

> -----Ursprüngliche Nachricht-----
> Von: Martin Evans [mailto:martin.evans@easysoft.com]=20
> Gesendet: Montag, 29. Januar 2007 17:25
> An: dbi-users@perl.org
> Betreff: alfred.mickautsch@schuler-ag.com - Bayesian Filter=20
> detected spam - Re: AW: CLOB Problem with DBD::ODBC/DBD::ADO=20
> for SQL Server
>=20
> Martin Evans wrote:
> >=20
[...]
> > so I'm not sure you are losing the new lines but I am sure=20
> your losing=20
> > half of your back slashes down to Perl.
> >=20
> > Martin
>=20
> Sorry, forgot to say. The inserted text is 100001 chrs according to=20
> length in Perl and the returned chr length is 97145. I had 1486 lines=20
> containing \\\\ and got 97145 chrs back so that suggests all=20
> I lost was=20
> every \\\\ turned into \\ (i.e. no loss of line feeds).
>=20
[...]

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).

Servus -- Alfred

--
Alfred Mickautsch

Schuler Business Solutions AG
Karl-Berner-Str. 4
D-72285 Pfalzgrafenweiler
tel: +49 (0)74 45 830-184
fax: +49 (0)74 45 830-349
e-mail: alfred.mickautsch@schuler-ag.com

Re: AW: Re: AW: CLOB Problem with DBD::ODBC/DBD::ADO for SQL Server

am 30.01.2007 10:43:45 von Martin.Evans

Mickautsch, Alfred wrote:
>> -----Ursprüngliche Nachricht-----
>> Von: Martin Evans [mailto:martin.evans@easysoft.com]
>> Gesendet: Montag, 29. Januar 2007 17:25
>> An: dbi-users@perl.org
>> Betreff: alfred.mickautsch@schuler-ag.com - 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