USoft Rule Language Examples: Query Statements With Subquery

Previous Next

See Also

The USoft Rule Language DO NOT ALLOW THAT keyword corresponds to the SQL WHERE keyword that introduces the first conditional clause ("WHERE-clause"). This is illustrated in the following examples.

 

Examples

 

USoft Rule Language

SQL Equivalent

FOR                  drivers d

DO NOT ALLOW THAT exists

(

 select        ''

 from                contract c

 ,                business_party b

 relate        b "PAYS FOR" c

 where                b.id = d.id

 and                c.paid = 'N'

)

select        ''

from        driver d

where exists

(

 select        ''

 from        contract c

 ,        business_party b

 relate b "PAYS FOR" c

 where        b.id = d.id

 and        c.paid = 'N'

)

FOR                  drivers d

DO NOT ALLOW THAT 3 <

(

 select        count(*)

 from                contract c

 ,                business_party b

 relate        b "PAYS FOR" c

 where                b.id = d.id

 and                c.paid = 'N'

)

select        ''

from        driver d

where 3 <

(

 select        count(*)

 from        contract c

 ,        business_party b

 relate b "PAYS FOR" c

 where        b.id = d.id

 and        c.paid = 'N'

)

FOR                  drivers d

DO NOT ALLOW THAT d.age <

(

 select        a.minimum_age

 from                application a

)

select        ''

from                driver d

where d.age <

(

 select        a.minimum_age

 from        application a

)