Discussion regarding the "in" operator

View: New views
4 Messages — Rating Filter:   Alert me  

Discussion regarding the "in" operator

by Carl Michael Skog :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is a pruned model of mine that was used with the "in"
operator(and that motivated the patch):

  <class>

        <name>tabCarModel</name>
       
        <variable>
          <name>Name</name>
          <type>text</type>
          <length>50</length>
        </variable>

...snip,snip...
        <collection>
          <name>Articles</name>
          <class>tabArt</class>
          <reference>CarModels</reference>
        </collection>
...snip,snip...
</class>

  <class>
        <name>tabArt</name>

        <variable>
      <name>ArtNr</name>
          <type>text</type>
          <length>50</length>
        </variable>
...snip,snip...
        <collection>
          <name>CarModels</name>
          <class>tabCarModel</class>
          <reference>Articles</reference>
        </collection>
</class>

This was used for in a report with a query like this:
  <query>

    <name>queryinstallpackages</name>

    <object>
      <name>theArticles</name>
      <class>tabArt</class>
    </object>

    <object>
      <name>theCarModel</name>
      <class>tabCarModel</class>
    </object>

    <column>
      <name>ArtNr</name>
      <value>
                <variable>
                  <name>ArtNr</name>
                  <object>theArticles</object>
                </variable>
          </value>
    </column>

    <column>
      <name>Name</name>
      <value>
                <variable>
                  <name>Name</name>
                  <object>theArticles</object>
                </variable>
          </value>
    </column>

        <filter>
          <object>
                <name>theArticles</name>
          </object>
          <in/>
          <collection>
                <name>Articles</name>
                <object>theCarModel</object>
          </collection>
        </filter>

  </query>



Regards,
Carl Michael Skog









 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/metal-dev/

<*> To unsubscribe from this group, send an email to:
    metal-dev-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Re: Discussion regarding the "in" operator

by mlemos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

on 02/13/2006 09:03 AM Carl Michael Skog said the following:
> This is a pruned model of mine that was used with the "in"
> operator(and that motivated the patch):

I tried this and it generates the SQL the way it is intended.

I even added a function addtocollection to confirm that the in operand
is using the right columns of the relationship table.

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/metal-dev/

<*> To unsubscribe from this group, send an email to:
    metal-dev-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Re: Discussion regarding the "in" operator

by Carl Michael Skog :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Indeed, it seems I got it wrong regarding the patch.

What do you think about using EXIST for implementing the "in"-operator ?

Regards,
Carl Michael Skog

--- In metal-dev@..., Manuel Lemos <mlemos@...> wrote:

>
> Hello,
>
> on 02/13/2006 09:03 AM Carl Michael Skog said the following:
> > This is a pruned model of mine that was used with the "in"
> > operator(and that motivated the patch):
>
> I tried this and it generates the SQL the way it is intended.
>
> I even added a function addtocollection to confirm that the in operand
> is using the right columns of the relationship table.
>
> --
>
> Regards,
> Manuel Lemos
>
> Metastorage - Data object relational mapping layer generator
> http://www.metastorage.net/
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/metal-dev/

<*> To unsubscribe from this group, send an email to:
    metal-dev-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Re: Re: Discussion regarding the "in" operator

by mlemos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

on 02/13/2006 11:34 PM Carl Michael Skog said the following:
> What do you think about using EXIST for implementing the "in"-operator ?

The in operator should not use sub-selects there is a solution that does
not require sub-selects, and so, it works on databases that do not
support sub-selects like MySQL 3 and 4 .

The not in operator seems to have no way to be implemented without
sub-selects. So be it. I am sure many developers will appreciate it
(including myself), even if that requires a database migration or upgrade.

I am just studying the subject a bit more to figure the exact SQL syntax
that implements the intended operation. I will reply to your other
message soon.

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/metal-dev/

<*> To unsubscribe from this group, send an email to:
    metal-dev-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/