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



Mickautsch, Alfred wrote:
-----Ursprüngliche Nachricht-----
Von: Martin Evans [mailto:martin.evans@xxxxxxxxxxxx]
Gesendet: Dienstag, 30. Januar 2007 10:44
An: dbi-users@xxxxxxxx
Betreff: Re: AW: Re: AW: CLOB Problem with DBD::ODBC/DBD::ADO for SQL
Server
[...]
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?

[...]
SQL Server: Microsoft SQL Server 2005 Version 9.00.1399.06
ODBC Driver: SQL Native Client Version 2005.90.1399.00
I do not use a dsn, I use a connect string like the following:
'Driver={SQL Native Client};Server=schuler-sql01;Database=coedev03'
There are no other settings in the string.

Servus -- Alfred

--
Alfred Mickautsch

and previously you said:

> When inserting data (ASCII data which comes from a Oracle CLOB) into a
> NCLOB on SQL Server, backslashes at the end of a line seem to be
> interpreted as escape characters and the backslash and the following
> newline are removed from the data.

I'm sorry Alfred but I just can't reproduce exactly what you describe. I lose no back slashes (other than those perl would remove if not using a single quoted string) and no line feeds.

I have now got script running on Windows xp, active state perl 5.8.8 build 819, DBI 1.52, DBD::ODBC 1.13. When I run the following script:

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

\\\\

\\\\

\\\\

_EOF
$s->execute($f);
print "length=", length($f);
$x = $h->selectrow_arrayref(q/select * from test_char/);
print "length=", length($x->[0]);

I insert 24 chars (16 \ and 8 line feeds) and I get back 24 chrs.

I am unsure why the code does not insert CR\LF as I am 100% sure the file itself contains CR\LF.

I have tried with ntext, text and char fields - no difference.

I have run it through a tds spy and can see the line feeds going through fine in both directions.

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



Relevant Pages

  • Re: SQL Losing Data
    ... the other problem wasn't a SQL Server thing. ... And I would argue that it was an ODBC driver issue, solely, not even Access. ... sidebar shows a pencil, indicating that edits are being performed. ... I've tried using Profiler in the past and found it a bit unwieldy. ...
    (microsoft.public.sqlserver.odbc)
  • Re: SQL Server 2005 "Left outer join" return nothing through ODBC call
    ... Some outer joins suddenly returned empty resultsets on SqlServer 2005 in 2000-compatibility-mode, but only within our application. ... The same query executed in Query Analyzer just worked fine. ... We finally solved that issue by upgrading to the latest SqlServer ODBC driver which can be found at: ... It did work for SQL Server 7.0 and SQL server 2000. ...
    (microsoft.public.sqlserver.odbc)
  • Re: localized ODBC driver datetime issue
    ... which I use to connect to MS SQL Server 2003. ... SS> format, because this format does not correspond to the Russian date ... SS> was a way to know the language used by the ODBC driver, ...
    (microsoft.public.data.odbc)
  • Re: Which is the best provider for SQL Server 2000 and VB6
    ... OLEDB Provider for SQL Server is the best choice. ... Second - ADO does NOT work with ODBC driver directly and in a case if you ...
    (microsoft.public.data.ado)
  • Re: dts retrieves 0 rows when scheduled...
    ... Have you tried logging in as the SQLAgent service account and running the ... job/checking out the ODBC driver? ... > There is no error massage i can trace in sql server or in any of its logs, ... > the job just passes gracefully by the dts data transfare tasks, ...
    (microsoft.public.sqlserver.dts)