[Zope-DB] sqltest and sqlgroup

Smith, Neil Neil.Smith@npower.com
Tue, 15 Jan 2002 09:32:02 -0000


I am using an Oracle 7.3.4 database on NT and the DCOracle2 DB adapter.  I
have created a Z SQL Method with arguments:

    title surname forename

And body:

    select * from referrals 
    <dtml-sqlgroup where>
      <dtml-sqltest title op=eq type=string optional>
    <dtml-and>
      <dtml-sqltest forename op=eq type=string optional>
    <dtml-and>
      <dtml-sqltest surname op=eq type=string optional>
    </dtml-sqlgroup>

I was expecting from the documentation that if I left any of the argumants
empty, then that part of the where clause would be ignored, So if I test it
and just enter a value of Smith for the surname it should generate a query:

    select * from referrals where surname = 'Smith'
However, on the test page, and when I try to use it, it always generates all
the clauses, i.e.
    select * from referrals where (title = '' and forename = '' and surname
= 'Smith' )
Am I doing something wrong, or is it not supposed to work like I thought it
should?

--------------------------------------------------
Neil Smith
nPower, Oak House, Worcester
Tel: (01905) 340466
mailto:neil.smith@npower.com

**********************************************************************
 
The information contained in this e-mail is confidential and intended only for the use of the addressee. If the reader of this message is not the addressee, you are hereby notified that you have received this e-mail in error and you must not copy, disseminate, distribute, use or take any action as a result of the information contained in it.
    
If you have received this e-mail in error, please notify postmaster@npower.com (UK 01384 275454) and delete it immediately from your system.
    
Neither Npower nor any of the other companies in the Innogy group from whom this e-mail originates accept any responsibility for losses or damage as a result of any viruses and it is your responsibility to check attachments (if any) for viruses.

Npower Limited
Registered office: Windmill Hill Business Park, Whitehill Way, Swindon SN5 6PB. Registered in England and Wales: number 3653277

This e-mail may be sent on behalf of a member of the Innogy plc group of companies.

**********************************************************************