gnue-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUe-dev] New condition-element available to Appserver


From: Johannes Vetter
Subject: [GNUe-dev] New condition-element available to Appserver
Date: Tue, 25 Jan 2005 12:02:15 +0100

Hi,

We've introduced a new condition-element 'exist'. It's main purpose is
to perform a sub-select and to return False if that sub-select was empty
or True if it was not empty.

Example: Invoicing

I want to see all customers that have an order for item 'FOO'.


Here comes the XML-Syntax of the new condition-element:

<datasource name="dtsFoo" ...>
 <condition>
 ...
 <exist table="detailtable" masterlink="f,f,..." detaillink="f,f,...">
  <condition>...</condition>
 </exist>
 ...
 </condition>
</datasource>

'table' defines the table to be queried by the sub-select.
'masterlink' specifies the fields to be compared from the current
datasource (i.e. 'dtsFoo')
'detaillink' specifies the fields in 'table', which must match with the
fields in 'masterlink'. Note: the order and number of items must be the
same.

An optional 'sub-condition' could be added. If it is given, this
condition will be used as condition for the subselect.


Example:

(To see the structures used for this example, please have a look at
gnue-appserver/samples/testing/joins/struct.gcd)


<datasource name="dtsCust" connection="appserver" table="test_customer">
    <condition>
      <exist table="test_lineitem" masterlink="gnue_id"
             detaillink="test_invoice.test_customer">
        <eq>
          <cfield name="test_item.test_code" />
          <cconst value="G1" />
        </eq>
      </exist>
    </condition>
  </datasource>


The above definition would select all rows from 'test_customer', which
have a result in: all rows from test_lineitem, where
test_invoice.test_customer matches the former row in 'test_customer'
*and* where 'test_item.test_code' is equal to 'G1'.



Thanks,

Johannes



-- 
BYTEWISE Software GmbH          Tel +43 (5577) 89877-0
i.A. Johannes Vetter            Fax +43 (5577) 89877-66
A-6890 Lustenau, Enga 2         http://www.bytewise.at
-------------------------------------------------------
Wir bieten die Installation von Debian GNU/Linux auf
Servern für kleinere Netzwerke zum Pauschalpreis an.
Mehr dazu unter http://www.bytewise.at/texte/pl-debian

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]