[ic] Searching tables

Kevin Flynn interchange-users@lists.akopia.com
Thu Jun 7 11:06:00 2001


I'd appreciate any further help with the piece of code below. I want to
search the description field in the orderline table to see what order
contains a particular product (i.e. Hand Planer) and pull back all relevant
information for that order (i.e. Order number, username, address, etc...).
which is held in the transactions table.

<snip>

[query
            sql="SELECT order_number, fname, lname, city, state, country,
order_date, status
            FROM transactions,orderline WHERE description LIKE
'given_keyword'
            AND transactions.order_number = orderline.order_number
[comment]===== I keep getting an INTERNAL SERVER ERROR when I put the above
line in =====[/comment]
"]
[sql-param order_number]
[sql-param order_date]
[sql-param fname]
[sql-param lname]
[sql-param city],
[sql-param state],
[sql-param country]
[sql-param status]
[/query]

</snip>


Regards,

Kevin Flynn
kflynn@celticlinks.com

----- Original Message -----
From: Mike Heins <mikeh@minivend.com>
To: <interchange-users@developer.akopia.com>
Sent: 06 June 2001 17:36
Subject: Re: [ic] Searching tables


> Quoting Kevin Flynn (kflynn@celticlinks.com):
> > I am trying to translate the sql statement below into a search region
where
> > it pulls from 2 tables.
> >
> >         SELECT * FROM transactions, orderline WHERE description =
> > "given_keyword" AND
> >         transaction.order_number = orderline.order_number;
> >
> > I want to search through the orders to see who bought a particular
product
> > (i.e. Hand Planer) and pull back all relevant information for that order
> > (i.e. Order number, username, address, etc...). The product Description
is
> > in the orderline table whereas all customer details are in the
transactions
> > table.
> >
> > I'd appreciate some help with this as I have been banging my head
against a
> > wall for ages trying to figure it out!
> >
>
> Can't do it with search-region. But if you have a SQL database
> then [query ...] will work. Bear in mind that any columns that are
> accessed with [sql-param field], not [sql-param table.field], and
> any named the same will not work with [sql-param field] but will with
> [sql-pos N].
>
> --
> Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
> phone +1.513.523.7621      <mheins@redhat.com>
>
> I have a cop friend who thinks he ought be able to give a new ticket;
> "too dumb for conditions".
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users
>