[ic] Tag->data for mulitple keys

interchange-users@icdevgroup.org interchange-users@icdevgroup.org
Wed Aug 28 01:17:01 2002


Quoting Barry Treahy, Jr. (Treahy@MMaz.com):
> 
> Barry Treahy, Jr. wrote:
> 
> > Kevin Walsh wrote:
> >
> >>> Is there a method to use Tag->data for finding a row based on 
> >>> multiple keys with the GDBM database?  I've seen nice solutions for 
> >>> SQL...  If not the tag, any other suggestions?
> >>>
> >>>   
> >>
> >> I suggest the [query] tag with SQL.  The SQL::Statement module will
> >> handle queries such as "SELECT foo FROM bar WHERE a = 1 AND b = 2"
> >> against GDBM tables.
> >>
> >> Do yourself a favour and move your GDBM data into MySQL or PostgreSQL.
> >>  
> >>
> > Advise well appreciated and heeded next time...
> >
> > Ok, here is the code snippet:
> >
> >  my $sql = "select discount from tiers where tier ='" . $tier ."' and 
> > quantity<=" . $quantity ." order by quantity desc"; 
> 
> 
> Ok, this is what I've identified, the query is not handling the quantity 
> test as if it numeric, but rather the ASCII collating sequence which 
> doesn't work because 100 is less than 25 in that situation!
> 
> What can I do to resolve this???
> 

catalog.cfg:

    Database tiers NUMERIC quantity

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

Just because something is obviously happening doesn't mean something
obvious is happening. --Larry Wall