By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,841 Members | 1,390 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,841 IT Pros & Developers. It's quick & easy.

Help on DBIx::Class

rajiv07
100+
P: 141
Hi to all

I have some problem to use DBIx::Class

Expand|Select|Wrap|Line Numbers
  1. package My::Schema;
  2. use base qw/DBIx::Class::Schema::Loader/;
  3.  
  4.   __PACKAGE__->loader_options(
  5.       debug         => 1,
  6.   );
  7.   __PACKAGE__->connection('dbi:mysql:music:localhost','root','');
  8.  
  9.   1;
  10.  
I have set my DBIx::Class using the above code and i have a perl script to get some value from albuminfo table .It is my testing stage only so please help on this. my perl script

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. use My::Schema; 
  3.  
  4. my $schema = My::Schema->connect("dbi:mysql:music:localhost", "root", "");
  5.  
  6. my $album = $schema->resultset('albuminfo')->find(14);
  7.  
  8. if ($album) {
  9.     print "Found ", $album->title, ", The ID = ", $album->albumid, "n";
  10. } else {
  11.     print "Can't find album.n";
  12. }
  13.  
But it gives some error

The Error

Expand|Select|Wrap|Line Numbers
  1. Base class package "DBIx::Class::Schema::Loader" is empty.
  2.     (Perhaps you need to 'use' the module which defines that package first.)
  3.  at C:/Perl/lib/My/Schema.pm line 2
  4. BEGIN failed--compilation aborted at C:/Perl/lib/My/Schema.pm line 2.
  5. Compilation failed in require at C:\DOCUME~1\INDIAM~1.COM\LOCALS~1\Temp\loc546.tmp line 2.
  6. BEGIN failed--compilation aborted at C:\DOCUME~1\INDIAM~1.COM\LOCALS~1\Temp\loc546.tmp line 2.

Regards
Rajiv
Apr 4 '08 #1
Share this Question
Share on Google+
1 Reply


numberwhun
Expert Mod 2.5K+
P: 3,503
Hi to all

I have some problem to use DBIx::Class

Expand|Select|Wrap|Line Numbers
  1. package My::Schema;
  2. use base qw/DBIx::Class::Schema::Loader/;
  3.  
  4.   __PACKAGE__->loader_options(
  5.       debug         => 1,
  6.   );
  7.   __PACKAGE__->connection('dbi:mysql:music:localhost','root','');
  8.  
  9.   1;
  10.  
I have set my DBIx::Class using the above code and i have a perl script to get some value from albuminfo table .It is my testing stage only so please help on this. my perl script

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. use My::Schema; 
  3.  
  4. my $schema = My::Schema->connect("dbi:mysql:music:localhost", "root", "");
  5.  
  6. my $album = $schema->resultset('albuminfo')->find(14);
  7.  
  8. if ($album) {
  9.     print "Found ", $album->title, ", The ID = ", $album->albumid, "n";
  10. } else {
  11.     print "Can't find album.n";
  12. }
  13.  
But it gives some error

The Error

Expand|Select|Wrap|Line Numbers
  1. Base class package "DBIx::Class::Schema::Loader" is empty.
  2.     (Perhaps you need to 'use' the module which defines that package first.)
  3.  at C:/Perl/lib/My/Schema.pm line 2
  4. BEGIN failed--compilation aborted at C:/Perl/lib/My/Schema.pm line 2.
  5. Compilation failed in require at C:\DOCUME~1\INDIAM~1.COM\LOCALS~1\Temp\loc546.tmp line 2.
  6. BEGIN failed--compilation aborted at C:\DOCUME~1\INDIAM~1.COM\LOCALS~1\Temp\loc546.tmp line 2.

Regards
Rajiv

Sorry, I don't know the answer but hopefully one of our experts will be able to assist you.

My appologies for the delay in getting an answer to your question.

Regards,

Jeff
Apr 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.