Subject Re: [IBO] Order of Perameters
Author Paul Schmidt
Jason:

Doesn't really help, let me explain what I am trying to do, and see
if that helps:

I have the following Tables

TABLE DELZONE

DELZONE_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR( 30) CHARACTER SET ASCII,
STREET VARCHAR( 30) CHARACTER SET ASCII,
CITY VARCHAR( 20) CHARACTER SET ASCII,
PROVINCE_ID INTEGER DEFAULT 0 NOT NULL,
POSTAL VARCHAR( 10) CHARACTER SET ASCII,
CUSTOMER_ID INTEGER DEFAULT 0 NOT NULL,

TABLE SHIPPER /* extranious felds have been removed */

SHIP_ID INTEGER NOT NULL,
NAME VARCHAR( 35) CHARACTER SET ASCII,
STREET VARCHAR( 35) CHARACTER SET ASCII,
CITY VARCHAR( 25) CHARACTER SET ASCII,
PROVINCE_ID INTEGER DEFAULT 0 NOT NULL,
POSTAL VARCHAR( 10) CHARACTER SET ASCII,
CUSTOMER_ID INTEGER DEFAULT 0 NOT NULL,
DELZONE_ID INTEGER DEFAULT 0 NOT NULL,

When I create a new shipper (a TIBOTable) the last thing it does when
it posts, is hunt for the proper DELZONE and fill in the DELZONE_ID

Now there are some tricks to this, they need to match on the
following criteria, CUSTOMER_ID first, then POSTAL, then STREET, CITY
and PROVINCE_ID, however it doesn't get easier, a DELZONE may not
have all of the values, for example if it covers a whole city, the
POSTAL, CUSTOMER_ID and STREET would not be filled in.

If this is still not complicated enough, POSTAL on the DELZONE may
not be the same length as on SHIPPER. POSTAL (short for Postal Code)
on a DELZONE could be as short as 1 or as long as 7, a shipper at M1M
1M1 needs to match the longest of M1M 1M1, M1M 1M, M1M 1, M1M, M1 or
M.

I thought about doing this as a big Query with a bunch of parameters,
but how does IB determine the order in the WHERE does it start at the
first one and work down, does it start at the bottom and work up, or
can I guarantee it with 15 pairs of brackets? If I run this query
500 times with the same data I need to know that I will get the same
answer.

I did it in Paradox with a built-on-the-fly query, it took longer
then to pour an Imperial gallon of Molassis on Baffin Island in
January....

Any ideas?

Paul



On 13 Mar 2001, at 16:15, Jason Wharton wrote:

To: <IBObjects@yahoogroups.com>
From: "Jason Wharton" <jwharton@...>
Date sent: Tue, 13 Mar 2001 16:15:56 -0700
Send reply to: IBObjects@yahoogroups.com
Subject: Re: [IBO] Order of Perameters

> Just make sure you put your parenthesis in the right way and you
> should be fine. If you need to have two parameters with the same name
> and be treated as a single parameter IBO will allow that if the
> physical data type of the columns being compared to are the same.
>
> HTH,
> Jason Wharton
> CPS - Mesa AZ
> http://www.ibobjects.com
>
>
> ----- Original Message -----
> From: "Paul Schmidt" <paul@...>
> To: <IBObjects@yahoogroups.com>
> Sent: Tuesday, March 13, 2001 8:47 AM
> Subject: [IBO] Order of Perameters
>
>
> >
> > Hi List:
> >
> > This is more an IB question then an IBO question, but since we seem
> > to have the same gurus here, and in IB Support, I'll post here....
> > I haven't tried this, but would like to know if I am thinking the
> > right way....
> >
> >
> > I have the following select :
> >
> > SELECT * FROM Table1 WHERE ((x = :x1 AND w= :w1 ) OR y= :y1 OR z=
> > :z1) AND
> >
> > Yes X1, Y1, Z1 and W1 are parameters, here are the possibilities
> >
> > X1/W1, Y1 and Z1 all contain values, that will return a different
> > set of records, which set can I expect to get back, the set
> > belonging to X1/W1, Y1 or Z1?
> >
> > X1, W1 and Y1 are NULL, in which case we do NOT want to match the
> > NULL, we want to get the set matching Z1 instead, will this happen?
> >
> > X1 = 'YONGE' , w1 = 'TORONTO' we want YONGE ST in TORONTO we do
> > not want, under any curcumstances YONGE ST in MOOSENOSE
> >
> > Am I being reasonable or am I far enough in left field to be off the
> > planet.....
> >
> > Thanks
> >
> > Paul
> >
> >
> >
> >
> >
> >
> >
> >
> > Paul Schmidt,
> > Tricat Technologies
> > Email: paul@...
> > Website: www.tricattechnologies.com
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-~> Make good on the promise you made at
> graduation to keep in touch. Classmates.com has over 14 million
> registered high school alumni--chances are you'll find your friends!
> http://us.click.yahoo.com/l3joGB/DMUCAA/4ihDAA/P0AVlB/TM
> ---------------------------------------------------------------------_
> ->
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>


Paul Schmidt,
Tricat Technologies
Email: paul@...
Website: www.tricattechnologies.com