[Dbix-class] Problem with column more than 80 chars long with MSSQL

Peter Rabbitson rabbit+dbic at rabbit.us
Tue Jan 20 22:18:18 GMT 2009


Chris Burch wrote:
> Hello,
> 
> I've just started using Catalyst, and therefore DBIx::Class, and I am running into a problem I hope someone can help me with.
> 
> I am connecting from an Ubuntu server (specs below) via unixODBC to a MSSQL 2000 database. Everything works fine until my comment field contains more than 80 (single byte) characters. I've defined the comment field as a varchar(255), nvarchar(255), and text to no avail.
> 
> Right now, my __PACKAGE__->add_columns is just a list of the columns, but I've tried specifying the data_type and size with no luck as well.
> ###
> __PACKAGE__->add_columns(qw/commentid calendarid sectionid termid taskid comment/);
> ###
> 
> Here is my result set search:
> 
> ###
>   my $comment_rs = $c->model('MMSDData::Comments')->search({
>     calendarid => $calendarid,
>     sectionid => $sectionid,
>     termid => $termid,
>     taskid => $taskid,
>   });
> ###
> 
> DBIC_TRACE gives me:
> ###
> 
> SELECT [me].[commentid], [me].[calendarid], [me].[sectionid], [me].[termid], [me].[taskid], [me].[comment] FROM [scoreCommenterComments] [me] WHERE ( [calendarid] = ? AND [sectionid] = ? AND [taskid] = ? AND [termid] = ? ): '1677', '302098', '574', '1002'
> Use of uninitialized value in join or string at /usr/share/perl/5.8/Carp/Heavy.pm line 125.
> 
> ###
> ... which is obviously not very helpful since Carp::Heavy is not happy with whatever it got.
> 
> The query works fine through unixODBC's isql utility tool.
> 
> Specs:
> Ubuntu 8.04
> unixODBC 2.2.11
> FreeTDS 0.82
> Perl v5.8.8 built for i486-linux-gnu-thread-multi
> Catalyst::Runtime 5.70
> DBIx::Class 0.08010
> DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server ... up to date
> Microsoft SQL Server 2000
> 
> Thanks in advance!
> Chris
> 

Please join us on irc.perl.org #dbix-class. It will be much faster to
resolve the problem "live". If you are unable to use irc for some reason
- someone will try to help you here.



More information about the DBIx-Class mailing list