On 11.Jun.2003 -- 11:32 AM, Amelie Cordier wrote:
> Thanks...
> 
> I have already looked at it but with no success so I'm looking for an
> example...
> 
> Anyway, thanks for the time you spend to answer my question :)

In a table-set you need to refer to tables by @name. This @name is
used to create the SQL statements. However, you might need different
views to a table (different number of columns, different keys) or even
have injected a SQL expression into the @name like a join
expression. In these cases you may refer to the @alias instead of the
@name of a table. For the lookup, @name and @alias are
equivalent. Search starts at the top and uses the first matching
table.

  <table name="foo">
    <!-- => INSERT INTO foo(one,two) VALUES (?,?) -->
    <!-- => DELETE FROM foo WHERE one = ? -->
    <keys>
      <key name="one" type="string"/>
    </keys>
    <values>
      <value name="two" type="string"/>
    </values>
  </table>

  <table name="foo" alias="foo2">
    <!-- => INSERT INTO foo(one,two,three,four) VALUES (?,?,?,?) -->
    <!-- => DELETE FROM foo WHERE one = ? -->
    <keys>
      <key name="one" type="string"/>
    </keys>
    <values>
      <value name="two" type="string"/>
      <value name="three" type="string"/>
      <value name="four" type="string"/>
    </values>
  </table>

  <table name="foo" alias="foo3">
    <!-- => INSERT INTO foo(four,one,two,three) VALUES (?,?,?,?) -->
    <!-- => DELETE FROM foo WHERE four = ? -->
    <keys>
      <key name="four" type="string"/>
    </keys>
    <values>
      <value name="one" type="string"/>
      <value name="two" type="string"/>
      <value name="three" type="string"/>
    </values>
  </table>

  <table-set name="alpha">
    <!-- uses the first table definition -->
    <table name="foo"/>
  </table-set>

  <table-set name="beta">
    <!-- uses the second table definition -->
    <table name="foo2"/>
  </table-set>

  <table-set name="gamma">
    <!-- uses the third table definition -->
    <table name="foo3"/>
  </table-set>

Could you have a look at the wiki page and modify it in a way you find
the description better / extent it? That would really by great!

Thanks.

        Chris.
-- 
C h r i s t i a n       H a u l
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to