Re: 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: Montag, 29. Januar 2007 17:25
An: dbi-users@xxxxxxxx
Betreff: alfred.mickautsch@xxxxxxxxxxxxxx - 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
.



Relevant Pages

  • Re: DBD::ODBC make test fails - unixODBC/Easysoft/SQL Server 2008
    ... Best regards, ... On Jun 30, 2009, at 11:52 AM, Martin Evans wrote: ... Connecting to a SQL Server 2008 instance running on a Server 2008 box. ...
    (perl.dbi.users)
  • RE: [dbi] executing MS SQL Server stored procedures
    ... > I am trying to run an MS SQL server stored procedure using Perl. ... Using the current Perl and DBI. ... > I use the 'exec' command but get syntax errors on the execute for the ... Martin J. Evans ...
    (perl.dbi.users)
  • Re: MsSQL DBD::ODBC IsNull and undef
    ... Martin J. Evans ... On 26-Jul-2005 Brian Becker wrote: ... > ensure you tell your driver the type of the column in bind_col. ... > I'd guess this is because the SQL Server ODBC driver is looking at your ...
    (perl.dbi.users)
  • Re: suggestions sought on returning rows from oracle proc and deleting them in same proc
    ... this is not Perl stuff but Oracle PL/SQL. ... The reason it is particularly applicable to DBD::Oracle is that it would be possible to solve my problem very easily IF DBD::Oracle supported the returning of oracle table types without pipelining - it doesn't. ... Martin I would write the patch for you on that but I am not sure OCI is aeven able to do that. ... I wasn't attempting to provoke someone into adding support for oracle table/array types to DBD::Oracle but the fact that they may only be obtained via pipelined functions and you cannot perform DML statements in a pipelined function meant I had a problem I could not see a solution to. ...
    (perl.dbi.users)
  • Re: How to access MS Access from Perl?
    ... if you were to later migrate to MS SQL Server or Oracle ... minimize your load on the database server's compiled procedure cache. ... On the other hand, if startup time for your perl script is an issue, and ... slightly preferable to the bulkier DBI + DBD::ODBC. ...
    (comp.lang.perl)