Re: QUESTION: Tables with the same name for different users?
Posted in 1993
->From: pardue@rainbow.ecn.purdue.edu (Jon Pardue) ->Subject: QUESTION: Tables with the same name for different users? ->Date: Fri, 13 Aug 1993 14:49:54 GMT ->Reply-To: pardue@rainbow.ecn.purdue.edu (Jon Pardue) ->Organization: Purdue University Engineering Computer Network -> ->Apologies if this is a FAQ, but I've got a question for all of you gurus: -> ->Q1: Is it possible to have two tables in the same database with the same -> table name and have different users pointing to one or the other? ->Q2: How can a 4GL application run unchanged in this environment without -> getting confused? -> ->Up until now, we have been using an Informix database under UNIX which ->resides in a single directory. We would like to be able to have multiple ->users access most of this database, but have their own version ->of a few tables. We do not want to simply merge the data into one table ->because this would mandate too many code changes. -> ->For example, User A and User B share the data in the product master table, but ->they have their own customer tables. Whenever the application code says ->something like, "select * from product_master", the shared product master ->table is read. Whenever it says, "select * from customer", the corresponding ->customer table is read for that user. -> ->Thanks for any help you can provide. -> ->- Jon ->-- ->---------------------------------------------------------------------------- ->Jon Pardue "The plural of 'spouse' is 'SPICE'." ->pardue@rainbow.ecn.purdue.edu - Charlie Gordon ->"Old musicians never die, they just go from bar to bar." - Anonymous -> Bob Baskett's suggestion of using private synonyms looks good to me. However, it might be version dependent. The "create private synonym" syntax does not appear in my 4.00 SQL Reference Manual. If your database is MODE ANSI, the converse approach also works. That is, use a single 'product_master' table, which has a PUBLIC synonym, or is referenced by 'owner.product_master'; and then each user can have their own 'custormer' table. I *think* this is the more general approach; at least it works in Oracle, tho' I don't know about this feature in other RDBMSs. Regards, Alan ___________________________ ______________________| R. Alan Popiel |__________________________ \\ Internet: | Martin Marietta, Tech Ops | / \\ alan@den.mmc.com | P.O. Box 179, M/S 5422 | Std disclaimers apply. / )Voice: | Denver, CO 80201-0179 USA | ( / 303-977-9998 |___________________________| (But you knew that!) \\ /________________________) (____________________________\\