Question

I need help writing this progress query: find first a no-lock where a.a = variable and a.b = variable2 and a.c = variable3 and ((a.d <> variable4 and a.e <> variable5 and a.f <> variable6) /* this "or in" is just sudecode for what I want it to do */ or in (first b no-lock where b.a = variable and (b.b = variable7 or b.b = variable8 no-error))) no-error.`

The "or in" is the thing I'm having trouble with.

Was it helpful?

Solution

Given the kind of statement you want to create, I suggest the following two-step process:

find first b no-lock where b.a = variable 
                           and (b.b = variable7 or b.b = variable8) no-error.

find first a no-lock where a.a = variable 
                           and a.b = variable2 
                           and a.c = variable3 
                           and ((a.d <> variable4 and a.e <> variable5 and a.f <> variable6) 
                                 or available b) 
             no-error.

OTHER TIPS

Don't think too much it like MS SQL query or the general scripting query.

like for each test1 no-lock where test1.a = var1 and test1.b = var2 no-error.

same as find first test1 no-lock where test1.a = var1 and (test1.b = var2 or test1.c = var3) no-error. // it gives you only one row at a time.

I believe the statement you are looking for is 'can-find'.

... or can-find(first b where b.a = a.a ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top