473,385 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help on DBIx::Class

rajiv07
141 100+
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
1 2316
numberwhun
3,509 Expert Mod 2GB
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

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

Similar topics

0
by: Mario Rosario | last post by:
Hi, I am getting an error which I don't understand why. I have an object Item which I serialize within a servlet and send it across to an applet but I get this run time error...
2
by: vincent delft | last post by:
Sorry if my question is stupid. I've missed something with classes. Can you explain the following ? class test: var1=1 var2=2 res=var1+var2 t=test() print t.res
6
by: Andreas Palsgård | last post by:
Hey.. i want to write a class object containing both strings and integers, to a file on disk, and be able to read it properly again at another time. I made the code below... it doesn't work, but...
1
by: David Goodyear | last post by:
At the moment im experimenting with ideas in C++ and would really like to solve the following, please please help. Sorry i dont even know what the subject is this would come under? :( Sorry if...
5
by: xuatla | last post by:
Hi, I encountered the following compile error of c++ and hope to get your help. test2.cpp: In member function `CTest CTest::operator+=(CTest&)': test2.cpp:79: error: no match for 'operator='...
16
by: Allen | last post by:
I have a class that returns an arraylist. How do I fill a list box from what is returned? It returns customers which is a arraylist but I cant seem to get the stuff to fill a list box. I just...
1
by: elsa | last post by:
hi everyone, i have a qustion that i cant solve in drwaing a uml class diagram and this is the case: ------------------------------------------------------------------------------------- In a...
0
by: Academia | last post by:
The Help Class example requires only a simple copy, paste into a form and run. Which I did. For it to relate to what I am trying to find out I set the "Help Navigator) combobox to "Topic" I...
3
by: fortysixfish | last post by:
Hi I've been learning more and more on C/C++ as time goes on. Today I wanted to play around by creating a class that makes it easier to use Windows Tokens. I get stumped though when trying to pass a...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.