Thanks for your help. However, I tried using 'prefetch', and I get the same results as if I were using 'join'.
I get the following error:
Can't locate object method "LName" via package "myDBPackage::Result::T +blRequests" at test_processed_requests.pl line 15, <DATA> line 751.
As you can see in my previous post, TblPerson does contain the column, 'LName'. That is the column name in the database, as well.
I made a slight change to the -or and -and to produce the correct where clause statement. In addition, I included the
following snippet of code, to the Calling Method:
$schema->storage->debug(1);
to produce the SQL Statement, below:
SELECT me.RID, me.PID, me.original_post_date, me.last_update, me.submit_date, me.status, me.sent_email, p.PID, p.FName, p.MI, p.LName, FROM tblRequests me JOIN tblPerson p ON p.PID = me.PID WHERE ( sent_email IS NOT NULL OR sent_email != '0000-00-00' ) AND ( status = ‘Offered’ OR status = ‘Denied’ OR status = ‘Cancelled’ OR status = ‘Conditional Offer’ )
So, the DBIx::Class call
my @proc_requests = $schema->resultset( 'TblRequests' )->search({ -or => [ status => 'Offered', status => 'Denied', status => 'Cancelled', status => 'Conditional Offer', ], -and => [ -or => [ sent_email => {'!=', undef }, sent_email => {'!=', '0000-00-00'}, ], ], }, { prefetch => 'p' } );
is correct. It produces the correct SQL Statement (above).
Yet, it can't find object method from the other table. Again, I get the same error whether
I use 'join' or 'prefetch'.
And when I run debug, it displays the where clause of the DBIx::Class call, but it bypasses
'prefetch' or 'join'.
In reply to Re^2: Problems Using Join in DBIx::Class
by phildeman
in thread Problems Using Join in DBIx::Class
by phildeman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |