Arev 3.1 problem using OR in select and list statements

Arev 3.1 problem using OR in select and list statements

Post by T1ME » Sun, 11 Jun 1995 04:00:00



I am having trouble Using OR and AND in select and list statements. It was
suggested to me that the problem had to do with multi-valued data. I am
able to select each component of the complex select/list by itself but not
connected with AND/OR.

I am rather new to Arev, but have been working with PICK for years. Is
there a USENET group especially for AREV?

Thanks,    T.Mead

 
 
 

Arev 3.1 problem using OR in select and list statements

Post by Bob Woodwa » Sun, 11 Jun 1995 04:00:00



Quote:

>I am having trouble Using OR and AND in select and list statements. It
was
>suggested to me that the problem had to do with multi-valued data. I
am
>able to select each component of the complex select/list by itself but
not
>connected with AND/OR.

>I am rather new to Arev, but have been working with PICK for years. Is
>there a USENET group especially for AREV?

>Thanks,    T.Mead

comp.databases.pick is pretty much the newsgroup that most of the
AREVer's hang out on.  Myself and at least half a dozen other good AREV
programmers are very willing to answer any questions that we can.  For
your particular problem, most of us would probably need to know what it
is that you're trying to do.  A LIST/SELECT statement with definition
of the types of fields that are involved in the WITH statements would
be enough to tell you what you're statement is going to do.  Don't
forget to include sample data.

In general, if you keep in mind that LIST and SELECT work basically
with the record keys.  If ANY value of a multi value field satisifies
the conditional test then the record ID is included.  Example:

Data:
key,field1,field2,mfield3,mfield4

001,APPLE,ORANGE,STICK,YELLOW
                 PAPER,GREEN
                 ROCK,BLUE
002,APPLE,PEAR,STICK,GREEN
               ROCK,RED
003,APPLE,WATERMELON,PAPER,RED
                     STICK,YELLOW

SELECT filename WITH mfield3 = "STICK" AND WITH mfield4 = "GREEN"

Result:  You will have record ID'S 001 and 002.

SELECT filename WITH field2 = 'PEAR' AND WITH mfield3 = "PAPER" OR WITH
   mfield4 = "RED"

Result:  You will have record ID's 002 and 003 because of the OR
condition.

To get the result of ('PEAR' and 'PAPER') or ('PEAR' and 'RED') there
would be a couple of different ways to approach this.  You could make
this two selects instead of one (first being 'PEAR' then second one for
'PAPER' or 'RED') or you could make a symbolic that tests for the
conditions.  I'm sure there are many other ways but these two are the
ones that I use the most depending on what I'm going.  If it's a quick
and dirty report, one time, I'll go for the symbolic (I use the same
symbolic name for all my quick and dirty reports so I don't fill the
DICT file with clutter)

This description is a little on the "light" side because you said you
were fairly new to AREV.  This does not account for duplicate values in
the multi-valued fields, and it also does not go into detail about the
record ID's returning the key value PLUS the value level, but I think
I've covered ONE aspect of working the Multi-value fields.  There is
alot more to this than what I've covered.

I'd be happy to answer other questions in email but you'd get a better
cross reference from some of the other AREVer's if you keep posting
general messages.

Hope I've helped some.
Bob (Oh! It's YOU, Bob!) Woodward  :)

 
 
 

Arev 3.1 problem using OR in select and list statements

Post by B. BUCHAN » Tue, 13 Jun 1995 04:00:00



>I am having trouble Using OR and AND in select and list statements. It was
>suggested to me that the problem had to do with multi-valued data. I am
>able to select each component of the complex select/list by itself but not
>connected with AND/OR.
>I am rather new to Arev, but have been working with PICK for years. Is
>there a USENET group especially for AREV?
>Thanks,    T.Mead

only suggestion I have is to make sure you are using the correct
statement

this statement will not work
list customers name address phone with lastname eq 'brown' or 'black'

this statement will work
list customers name address phone with lastname eq 'brown' or lastname
eq 'black'

Hope this helps out

Re: trying to find help from arev. They do not as yet offer this
service on the internet, but sure wish they would. The manuals are so
so as far as I am concerned, and trying to find after market books is
impossible, at least up here in Canada...

 
 
 

Arev 3.1 problem using OR in select and list statements

Post by big.. » Tue, 13 Jun 1995 04:00:00



[snip]
Quote:>Re: trying to find help from arev. They do not as yet offer this
>service on the internet, but sure wish they would. The manuals are so
>so as far as I am concerned, and trying to find after market books is
>impossible, at least up here in Canada...

Revelation Technologies does maintain a forum on Compuserve, GO
REVELATI.  There are no aftermarket books.

Bob Wanamaker

 
 
 

Arev 3.1 problem using OR in select and list statements

Post by apk » Wed, 14 Jun 1995 04:00:00


Re: OR in ARev

3.1 and 3.11 did not use the same AND/OR logic as Pick.  3.12
moved back to the Pick style of precedence. 3.1 and 3.11 used a
SQL/C++ AND/OR precedence logic.

apk

 
 
 

Arev 3.1 problem using OR in select and list statements

Post by Rob Kream » Fri, 16 Jun 1995 04:00:00


Gee, so this is where all the AREV programmers have been hiding. :)  I
find them just in time to make the move over to PowerBuilder.  I've been
using AREV since 1.1, and it's time to try something different...

I'll be lurking in this group more closely now, as I also want to learn
more about Pick.

--
Rob Kreamer                          *   http://vaxxine.com/kreamer
Software Development 'Nut'           *

--
Internet Service From the Friendly Folks at

 
 
 

Arev 3.1 problem using OR in select and list statements

Post by Pana » Mon, 19 Jun 1995 04:00:00


There was a problem discovered when performing LIST or SELECT statements
when using multi criteria in AR V3.1.  A statement such as the one below
may mis-behave:

SELECT TABLENAME WITH COLUMN1 = "VALUE" AND WITH COLUMN2 = "VALUE2"

It will return the correct items if you type it like this:

SELECT TABLENAME WITH COLUMN1 = "VALUE" AND (WITH COLUMN2 = "VALUE2")

Hope this helps... Richard

 
 
 

Arev 3.1 problem using OR in select and list statements

Post by CDSteven » Wed, 21 Jun 1995 04:00:00


I don't use arev, but I think I know what you are talking about.
I believe there is a way of creating a "virtual attribute" ( i dont know
if that's what arev calls them) in the dictionary that contains some sort
of calculation written in basic code.   Sometimes the easiest way is to
put the entire complex selection criteria inside one of these basic
expressions, use nested parenthases to your hearts content,  returning
trye or false, depending on whether it meets your selection criteria or
not.

Incidently,  does anyone besides Unidata honors nested parenthses at TCL?
:

SELECT CAR WITH ( ( ( DRIVE.WHEELS = 4 AND GUN.RACK = 1 )  OR (CYLINDERS

Quote:>= 8 AND CARB.BARRELS = 4 AND TOP = '' ) ) AND COLOR = 'RED' )

   meaning

I want a 4-wheel drive with a gun rack or a hot convertible,  but in
either case it better be red.

 
 
 

Arev 3.1 problem using OR in select and list statements

Post by Bob Woodwa » Fri, 23 Jun 1995 04:00:00



Quote:

>I don't use arev, but I think I know what you are talking about.
>I believe there is a way of creating a "virtual attribute" ( i dont know
>if that's what arev calls them) in the dictionary that contains some sort
>of calculation written in basic code.   Sometimes the easiest way is to
>put the entire complex selection criteria inside one of these basic
>expressions, use nested parenthases to your hearts content,  returning
>trye or false, depending on whether it meets your selection criteria
or
>not.

>Incidently,  does anyone besides Unidata honors nested parenthses at
TCL?
>:

>SELECT CAR WITH ( ( ( DRIVE.WHEELS = 4 AND GUN.RACK = 1 )  OR
(CYLINDERS
>>= 8 AND CARB.BARRELS = 4 AND TOP = '' ) ) AND COLOR = 'RED' )

>   meaning

>I want a 4-wheel drive with a gun rack or a hot convertible,  but in
>either case it better be red.

In AREV they are called SYMBOLIC dictionary items.  This would be a
good solution only if the conditions do not change.  If they don't
change then this would be the perfect solution.

As to the nested parentheses, I've never tried.  Nope...  Guess not in
AREV.  Or I should say not by the way I just tested it....

 
 
 

Arev 3.1 problem using OR in select and list statements

Post by Astarte » Thu, 29 Jun 1995 04:00:00



writes:

Quote:>There was a problem discovered when performing LIST or SELECT
>statements when using multi criteria in AR V3.1.  A statement such as the
one
>below  may mis-behave:

Ummmm...and I believe there is a patch for this...contact RevTi

Astarte

 
 
 

1. Arev 3.1 Does anyone know if compound selects are available in Arev 3.1

I have run into a problem with Advanced Revelation 3.1. Example:

: SELECT DBFILE WITH SOME_DATE AFTER "1/1/95" AND WITH STATUS "A"

The problem is that the AND portion of the select statement is completely
ignored. I have resorted to successive select statements for AND
conditions, but
still have no solution for OR conditions. Please Help!!!

2. DTS error? change server via activeX, transformations do not follow...

3. Arev 3.1 Lockup Problem

4. Invalid Pointer problem with ADO

5. AREV 3.1 BUMP PROCEDURE PROBLEM

6. Win95 ODBC for Sybase 11.0.3

7. Comparison of AP/DOS 6.1 and AREV 3.1

8. HELP! Stored Java works differently than Stand alone

9. ARev 3.1 is out (Press Release)

10. Arev 3.1 printing question

11. AREV 3.1

12. ARev 3.1 is out (Press Release)

13. Comparison of AP/DOS 6.1 and AREV 3.1