[Zope] testing for existence of value in SQLtable

Graham Chiu anon_emouse@hotmail.com
Wed, 29 Mar 2000 23:11:55 +1300


In article <38E1D30A.2B65E5BA@inghist.nl>, Rik Hoekstra
<rik.hoekstra@inghist.nl> writes
><dtml-if> 
>   [here follows the test for the existence of a value in a table]
>   insert items into table
></dtml-else>
>   update item in table
></dtml-if>
>
>This problem probably came along before on the lists, but I can't find
>it anymore...

How about

<dtml-in "sqlFindItem(item=itemid)">
  <dtml-if sequence-start>
     do insert
  </dtml-if sequence-start>
<dtml-else>
     do update
</dtml-in>


-------
Regards,        Graham Chiu
gchiu<at>compkarori.co.nz
http://www.compkarori.co.nz/x.php?/Auctions
http://www.compkarori.com/dynamo - The Homebuilt Dynamo
http://www.compkarori.com/dbase - The dBase bulletin