[Catalyst] MSSQL and Catalyst
Alan Humphrey
alan.humphrey at comcast.net
Thu Aug 24 04:03:05 CEST 2006
I had some time so I decided to upgrade my app and see if I could take
advantage of all this. No joy. Im still getting bind parameters. Info
below. Any ideas?
Thank you!
- Alan
Version:
~/birdweb/trunk/BirdWeb-Admin > perldoc -l DBIx::Class | xargs cat | grep -i
'$version'
use vars qw($VERSION);
$VERSION = '0.07001';
Output:
~/birdweb/trunk/BirdWeb-Admin > perl test.pl
SELECT me.id, me.genus_id, me.species_name_id, me.image_id,
me.north_america_map_id, me.washington_map_id, me.default_sound_id,
me.default_bird_common_name_id, me.generic_bird_common_name_id,
me.taxonomic_order, me.identification, me.voice, me.habitat, me.behavior,
me.diet, me.nesting, me.migration, me.where_found, me.conservation_status,
me.breeding, me.notes FROM birds me WHERE ( ( me.id = ? ) ): '56'
Test program:
#!/usr/pkg/bin/perl -w
use strict;
use lib 'db';
use Production;
my $schema = Production->connect('dbiinfo','user','pass');
my $bird = $schema->resultset('Birds')->find(56);
if ($bird) {
$bird->set_column("voice", "blah blah");
} else {
print "no bird\n";
}
exit 0;
Production.pm
package Production;
use strict;
use base 'BirdWebSchema';
__PACKAGE__->storage_type('::DBI::Sybase::MSSQL')
1;
BirdWebSchema.pm:
package BirdWebSchema;
use strict;
use base qw/DBIx::Class::Schema/;
__PACKAGE__->load_classes( qw/Birds/);
1;
Birds.pm:
package BirdWebSchema::Birds;
use strict;
use base qw/DBIx::Class/;
__PACKAGE__->load_components( qw/Core/ );
__PACKAGE__->table('birds');
__PACKAGE__->add_columns( qw [id genus_id species_name_id image_id
north_america_map_id
washington_map_id default_sound_id
default_bird_common_name_id
generic_bird_common_name_id
taxonomic_order identification voice habitat
behavior
diet nesting migration where_found
conservation_status breeding
notes]);
__PACKAGE__->set_primary_key( 'id' );
1;
-----Original Message-----
From: catalyst-bounces at lists.rawmode.org
[mailto:catalyst-bounces at lists.rawmode.org] On Behalf Of Brandon Black
Sent: Monday, August 14, 2006 9:31 AM
To: The elegant MVC web framework
Subject: Re: [Catalyst] MSSQL and Catalyst
On 8/14/06, Brandon Black <blblack at gmail.com> wrote:
This solves both the bind variable issue and the prepare_cached issue for
DBD::Sybase+FreeTDS+MSSQL.
Actually, I went back and double-checked this, and it doesn't have the code
to prevent the memory issues w/ prepare_cached. It was meant to, but
apparently that little snippet didn't get done. Expect it in 0.07001.
-- Brandon
More information about the Catalyst
mailing list