[Dbix-class] DBIx JOIN issue in New version

Sheeju Alex sheejuec7 at gmail.com
Wed Feb 12 07:55:41 GMT 2014


I have upgraded to SQL::Abstract 1.77 version but still I see this issue

I have upgraded to DBIx::Class 0.08270 version but still I see this issue

Here is the relationship between AlertContact table and AlertProfile

__PACKAGE__->belongs_to(
    Profile => 'PAMS::WWW::Schema::Result::AlertProfile',
    {
        'foreign.Id' => 'self.ProfileId'
    }
);

Here is the search call

        my $alert_contact = $c->model('PAMSDB::AlertContact')->search(
            {
                'Profile.ReferenceId' => $profile->{ID},
                'Name'                => $href->{ContactMethod}
            },
            {'join' => 'Profile'}
        )->first;

Still this gives below Error

DBI Exception: DBD::Pg::st execute failed: ERROR:  syntax error at or near
"IDENT"
LINE 1: ...  JOIN "AlertProfile" "Profile" ON "Profile"."Id" IDENT $1 W...
                                                             ^ [for
Statement "SELECT * FROM "AlertContact" "me"  JOIN "AlertProfile" "Profile"
ON "Profile"."Id" IDENT ? WHERE ( ( "Name" = ? AND "Profile"."ReferenceId"
= ? ) )" with ParamValues: 1='me.ProfileId', 2='Office Email', 3='1']

Please help..

Best Regards,
Sheeju Alex

> After upgrading to new DBIX version my JOIN statement is failing, here is
> > the query in new and old version
>
> Could you please show us the relationship definition and the ->search()
> call(s) you are using that lead to these queries?
>
> > ** WORKING in this version
> >
> > DBIx Version: 0.08195
> >
> > SELECT * FROM "AlertContact" "me"  JOIN "AlertProfile" "Profile" ON
> > "Profile"."Id" = "me"."ProfileId" WHERE ( ( "Profile"."Refe
> > renceId" = ? AND "me"."Name" = ? ) ): '1', 'Email'
> >
> >
> > ** NOT WORKING in this version
> >
> > DBIx Version: 0.08250
>
> This is not the most recent version, 0.08270 is out now. Could you try
> that as well?
>
> > SELECT * FROM "AlertContact" "me"  JOIN "AlertProfile" "Profile" ON
> > "Profile"."Id" *IDENT* ? WHERE ( ( "Profile"."ReferenceId" = ? AND
> > "me"."Name" = ? ) )" with ParamValues: 1='me.ProfileId', 2='1',
> 3='Email']
> >
> > I see extra keyword IDENT in JOIN statement, Can you please let me know
> > how to fix it?
> >
> > Thanks,
> > Sheeju
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20140212/66713409/attachment.htm>


More information about the DBIx-Class mailing list