dbTalk Databases Forums  

How to give nested selection in TCL

comp.databases.pick comp.databases.pick


Discuss How to give nested selection in TCL in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ani
 
Posts: n/a

Default How to give nested selection in TCL - 03-20-2006 , 03:34 AM






Hi
how do i give nested conditions in D3 with brackets
eg:
list customer customer-id with (customer-id = "10" or with dept =
"sales")
when i execute this in D3, it gives me an error saying
"'('
not on file"
can you please guide as what we are supposed to do

Advance Thanks,

Anish


Reply With Quote
  #2  
Old   
Ross Ferris
 
Posts: n/a

Default Re: How to give nested selection in TCL - 03-20-2006 , 05:08 AM






Unlike SQL you don't need the brackets ... the query is "understood" as
plain english .... so

list customer customer-id with customer-id = "10" or with dept =
"sales"

will give you the required results


Reply With Quote
  #3  
Old   
Steve Mattson
 
Posts: n/a

Default Re: How to give nested selection in TCL - 03-20-2006 , 09:48 AM



Hi Anish,

I don't know about D3 specifically, but in mvBASE, R83 and probably most
other multi-value systems you need to also understand how the system parses
the statement. The system will parse on the OR in the statement. So, if your
selection criteria includes both AND and OR, make sure to repeat all
required ANDs on both sides of the OR.

For instance:

SELECT filename WITH ITEM1 = "A" "B" "C" AND WITH ITEM2 = "D" OR WITH ITEM3
= "E" AND WITH ITEM2 = "D"

In this statement records with ITEM2 = "D" will be selected as long as
either ITEM3 = "E" or ITEM1 has a value of "A", "B" or "C". The implied OR
for ITEM1 does not affect the parsing. If you don't repeat the ITEM2 = "D"
on the right-hand side of the OR, all records with ITEM3 = "E" will be
selected regardless of the value of ITEM1 or ITEM2.

Good luck,
Steve

"Ross Ferris" <rossf (AT) stamina (DOT) com.au> wrote

Quote:
Unlike SQL you don't need the brackets ... the query is "understood" as
plain english .... so

list customer customer-id with customer-id = "10" or with dept =
"sales"

will give you the required results




Reply With Quote
  #4  
Old   
Homer L. Hazel
 
Posts: n/a

Default Re: How to give nested selection in TCL - 03-20-2006 , 10:16 AM



Steve,

I think that "OR" resets the selection criteria. It's my belief that your
selection:

Quote:
SELECT filename WITH ITEM1 = "A" "B" "C" AND WITH ITEM2 = "D" OR WITH
ITEM3 = "E" AND WITH ITEM2 = "D"
will select from filename with two totally different criteria.

It will select items that match WITH ITEM1 = "A""B""C" AND WITH ITEM2 = "D"

and it will select also those that match

WITH ITEM3 = "E" AND WITH ITEM2 = "D"

AHA - I've re-read your post and this seems to be what you are saying. Your
last
sentence had me confused because I did not see the "If you do not". Shame
on me.

Larry Hazel


"Steve Mattson" <nothing (AT) nospam (DOT) net> wrote

Quote:
Hi Anish,

I don't know about D3 specifically, but in mvBASE, R83 and probably most
other multi-value systems you need to also understand how the system
parses the statement. The system will parse on the OR in the statement.
So, if your selection criteria includes both AND and OR, make sure to
repeat all required ANDs on both sides of the OR.

For instance:

SELECT filename WITH ITEM1 = "A" "B" "C" AND WITH ITEM2 = "D" OR WITH
ITEM3 = "E" AND WITH ITEM2 = "D"

In this statement records with ITEM2 = "D" will be selected as long as
either ITEM3 = "E" or ITEM1 has a value of "A", "B" or "C". The implied OR
for ITEM1 does not affect the parsing. If you don't repeat the ITEM2 = "D"
on the right-hand side of the OR, all records with ITEM3 = "E" will be
selected regardless of the value of ITEM1 or ITEM2.

Good luck,
Steve

"Ross Ferris" <rossf (AT) stamina (DOT) com.au> wrote in message
news:1142852899.347469.98190 (AT) v46g2000cwv (DOT) googlegroups.com...
Unlike SQL you don't need the brackets ... the query is "understood" as
plain english .... so

list customer customer-id with customer-id = "10" or with dept =
"sales"

will give you the required results






Reply With Quote
  #5  
Old   
rcamarda
 
Posts: n/a

Default Re: How to give nested selection in TCL - 03-20-2006 , 01:39 PM



Try dropping the second WITH
LIST CUTOMER CUSTOMER-ID WITH (CUSTOMER-ID ="10" OR DEPT="SALES)
This works in UV:
LIST STDMAS WITH (F1 = "SMITH" OR F2="JOHN") F1 F2 F3
HTH
Rob


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.