[ic] Accessing another catalog's products table

Bill Carr interchange-users@icdevgroup.org
Thu Aug 22 08:08:03 2002


On Thu, 2002-08-22 at 07:30, allmanj@houseofireland.com wrote:
> I am using interchange with mysql and everything is looking rosy so far. i have
> sites up and running using interchange but now i've run into a bit of a problem.
> 
> i want to have a catalog with its products table in its own database but to use
> the products table from another catalog (and another database) as well. i'm
> trying to think of a way to avoid the name conflict, any ideas?
> 
> to make it clearer lets say catalog1 and catalog2 both running on the same
> machine with two databases, one for each catalog.
> 
> i want catalog1 to have, from its point of view, another table (aside from the
> ones automatically given to it) that is in fact the products table from catalog2.
> 
> it would be nice if catalog1 could access the products table from catalog2 as
> cat2products or something...
> 
> i know it is possible to use a table from another catalog, but i believe this
> case is difficult because i want the name it is accessed by to be different to
> the name in the actual database. is this even possible?
catalog1.cfg:
Database        db2.products      REAL_NAME       products
NoImport        db2.products

some_page.html:
[query
	list=1
	sql=|SELECT * FROM db2.products ORDER BY title|
]
	[list]
		[sql-code] [sql-param title]<br>
	[/list]
[/query]

-- 
Bill Carr
Worldwide Impact
bill@worldwideimpact.com
413-253-6700