Selects to MS SQL Server 2000

From: Marcus Willemsen (marcus.willemsen_at_juve.de)
Date: 12/15/03


Date: Mon, 15 Dec 2003 15:34:46 +0100
To: <dbi-users@perl.org>

Hi everybody,

I managed to establish a connection with Microsofts SQL Server 2000
using DBI without any problems. My only problem is SELECTing textfields
from the database. A query like:
---Snippet---
my $sth = $dbh->prepare("SELECT [textfield] FROM
[database].[dbo].[table] WHERE [id] = 3315");
$sth->execute;
if(my $r = $sth->fetchrow_hashref){
        print ("$r->{textfield}");
}
else {
        print("No Entry<br>");
}
---Snippet---
Always results in a "No Entry" despite the fact that there is an entry
in the table. I get a result using the SQL Query Analyzer. So is there
anything special about SELECTing textfields?

Greetings Marcus



Relevant Pages

  • Re: Selects to MS SQL Server 2000
    ... I managed to establish a connection with Microsofts SQL Server 2000 ... Always results in a "No Entry" despite the fact that there is an entry ... I get a result using the SQL Query Analyzer. ... anything special about SELECTing textfields? ...
    (perl.dbi.users)
  • Re: Selects to MS SQL Server 2000
    ... > I managed to establish a connection with Microsofts SQL Server 2000 ... > using DBI without any problems. ... I get a result using the SQL Query Analyzer. ... > anything special about SELECTing textfields? ...
    (perl.dbi.users)
  • RE: Selects to MS SQL Server 2000
    ... Okay, I've traced my query and apparently the LongReadLen attribute for ... the ODBC driver is set to 0 by default but after changing it everything ... I get a result using the SQL Query Analyzer. ... >> anything special about SELECTing textfields? ...
    (perl.dbi.users)
  • Re: Selects to MS SQL Server 2000
    ... > I managed to establish a connection with Microsofts SQL Server 2000 ... > using DBI without any problems. ... I get a result using the SQL Query Analyzer. ... > anything special about SELECTing textfields? ...
    (perl.dbi.users)