in reply to Re: Proper way to drilldown using DBIx::Class?
in thread Proper way to drilldown using DBIx::Class?

Howdy NetWallah! Thanks! I actually been lurking around PerlMonks for a long time and usually found what I needed. So I didn't need to post anything, until now. I'm sure I'll be posting again soon! 8uO I had to look up what dbicdump. I just copied and pasted everything from the DBIx::Class::Manual::Example doc. I'm just getting started on learning DBIx:Class, so outside of my one experiment. I have ventured outside of the examples at all. Your code was great!! Here's the code changes:

use strict; use lib qw( ... ); use MyDatabase::Main; my ($s_seconds, $s_microseconds) = gettimeofday; my $schema = MyDatabase::Main->connect('dbi:mysql:dbname=test', "xxxxxx", "XXXXX"); my $artistname = 'Michael Jackson'; my $artists_rs = $schema->resultset('Artist'); ## my $artists_rs = $schema->resultset('Artist')->search( ## { 'name' => "Micha +el Jackson" } ## ); while (my $a = $artists_rs->next) { print "Artist ID: ", $a->artistid, ".) ", $a->name, ".\n"; my $cd_rs = $a->cds; while (my $c = $cd_rs->next) { print " CD Id: ", $c->cdid, ".) ", $c->title, ".\n"; my $track_rs = $c->tracks; while (my $t = $track_rs->next) { print " ID: ", $t->trackid, ".) ", $t->title, ".\n"; } print "\n"; } ## CD's Loop. print "\n"; } ## Artists Loop. my ($e_seconds, $e_microseconds) = gettimeofday; my $elapsed = tv_interval( [$s_seconds, $s_microseconds], [$e_seconds, $e_microseconds] ); print "Elapsed:${elapsed}.\n";
... And the Results:
Artist ID: 1.) Michael Jackson. CD Id: 1.) Thriller. ID: 3.) Billie Jean. ID: 6.) Beat It. CD Id: 2.) Bad. ID: 4.) Leave Me Alone. ID: 5.) Smooth Criminal. ID: 7.) Dirty Diana. Artist ID: 2.) Eminem. CD Id: 3.) The Marshall Mathers LP. ID: 1.) The Way I Am. ID: 2.) Stan. Artist ID: 3.) Nick Drake. CD Id: 4.) Pink Moon. ID: 9.) From the Morning. ID: 10.) Pink Moon. ID: 14.) Things Behind the Sun. CD Id: 6.) Bryter Layter. ID: 8.) Northern Sky. ID: 13.) Bryter Layter. Artist ID: 4.) The Doors. CD Id: 5.) LA Woman. ID: 11.) Riders on the Storm. ID: 12.) Love Her Madly. Elapsed:0.223685.

Bless you for your kindness and sharing! PS - Is there a place to check that your response was the correct answer (like stackoverflow.com)? Since you should get your creds

Replies are listed 'Best First'.
Re^3: Proper way to drilldown using DBIx::Class?
by NetWallah (Canon) on Jul 24, 2013 at 03:23 UTC
    You are quite welcome!

    PerlMonks does not have a "correct Answer" category - everything is based on reputation of the node - You can credit me by upvoting (++) my writeup.

    FYI - I upvoted yours, because you followed up with acknowldgement, and a a final. functioning solution for others to follow.

    Cheers! , and FYI - The Doors are one of my favourites. I was saddened when Ray Manzerek passed away 2 months ago.

                 My goal ... to kill off the slow brain cells that are holding me back from synergizing my knowledge of vertically integrated mobile platforms in local cloud-based content management system datafication.

      Howdy Netwallah,
      I don't think I have voting rights yet. I don't see any ++ around your replies. Bummer! It looks like they give you votes until after so many posts & as you move up through the ranks. Maybe, I can wash some dishes to get some points. When I get voting rights, I promise to give you the first.

      The doors "L. A. Woman" was my first LP! Great Band and he was performed magic on the keyboards.
      Thanks Again your help!!