Re: Using 'in' in add_constructor

[prev] [thread] [next] [Date index for 2004/09/27]

From: merlyn (Randal L. Schwartz)
Subject: Re: Using 'in' in add_constructor
Date: 11:46 on 27 Sep 2004
>>>>> "You" ==   <Daniel.Brunkhorst@xxxxxxxx.xx> writes:

You> __PACKAGE__-> add_constructor( links_in => 'link_id in ( ? )' );

You> If I understand the way add_constructor works correctly, this is
You> equivalent to
You> select __ESSENTIAL__ from __TABLE__ where link_id in ( ? )

You> Correct?

Correct, and that's your problem.  One "?" is one value.
Not a list of values.  You'll have to prepare a different links_in2
for two items, like 'link_id in (?, ?)' and so on.

That's partly why I headed to the more general (and yet nearly
as fast) solution wrapped around SQL::Abstract.  Search the CDBI
Wiki for my name or SQL::Abstract.

        -- 
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxx.xxx> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Using 'in' in add_constructor
10:33 on 27 Sep 2004

Re: Using 'in' in add_constructor
merlyn (Randal L. Schwartz) 11:46 on 27 Sep 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52