Gossamer Forum
Home : Products : DBMan SQL : Discussion :

getting data from foreign tables

Quote Reply
getting data from foreign tables
Hi,

Hope someone can help me with this one. I Have the following tables (the relations are known to DBMan SQL):

streets: id, name, city_id
cities: id, name, country_id
countries: id, name

I have a street id and I need the name of the related city and country. What would be an elegant way to do that?

Thanks, Jasper

http://www.bookings.org
Quote Reply
Re: [jaspercram] getting data from foreign tables In reply to
Hi,

You can use 'query' feature to accomplish this issue, i.e: create a query based on streets, cities and countires tables.

Have a look at the manual for more information.

TheStone.

B.
Quote Reply
Re: [TheStone] getting data from foreign tables In reply to
I was wondering if there was a way to use the relations that DBMan SQL is aware of. Subroutines that would use the known relations to answer queries like 'give me all cities of this country' or 'give me the city (or even country) where this street is in'...

Jasper

http://www.bookings.org
Quote Reply
Re: [jaspercram] getting data from foreign tables In reply to
As I metioned in my last posted, you will be able to get the detail information from the query by the URL:

db.cgi?do=qsearch_results&db=table_name&q=query_name&table_name.field_name=xxxx

E.g: If you want to get the city name and country name, the URL should be:

db.cgi?do=qsearch_results&db=streets&q=query_name&streets.street_ID=xxx

Hope that helps,

TheStone.

B.

Last edited by:

TheStone: Dec 9, 2002, 2:33 PM