List:General Discussion« Previous MessageNext Message »
From:Benjamin Pflugmann Date:May 21 1999 3:50am
Subject:Re: Cross Database queries (Re: query on tables in second database when connection was )
View as plain text  
Hi.

IMHO, what he meant was, that we would like/need a full example in the
following sense: a compiled list of shell and SQL commands, which
produce the shown problem for you (including the table creation and
data insertion, too) and which will run on any mysql installation
(i.e. no databases or such need to exist already, except for what you
got after the installation).

So we can try to reproduce the problem exactly. Not considering the
fact, that some may do not have so much spare time, it does not make
sense, that we compile such a list of commands ourselves, since we
could not be sure, wether we just avoided by accident what causes the
problem on your system. (i.e. he said, he could not reproduce the
problem).

Bye,

	Benjamin.

On Tue, May 18, 1999 at 06:00:08PM -0700, you wrote
> What I did is:
> 
> mysql -uXXX -pYYY A
> mysql> select * from B.region_xref where B.region_xref.main_id=20483
>      -> go
>  Empty set (0.00 sec)                              <==== Did not work across
> database
> 
>  mysql> use B
>  > Database changed
>  mysql> select * from B.region_xref where B.region_xref.main_id=20483
>      -> go                                      <============= It works
>  from the same database
>  +---------+-----------+
>  | main_id | region_id |
>  +---------+-----------+
>  |   20483 |         3 |
>  |   20483 |        10 |
>  |   20483 |         1 |
>  |   20483 |         5 |
>  |   20483 |         7 |
>  |   20483 |         8 |
>  +---------+-----------+
> 
> Could I do cross-database queries?
> 
> Scott
> 
> Christian Mack wrote:
> 
> > Scott Liu wrote:
> > >
> > > I have tried the method to query tables in other database (B) when a
> > > connection is made for
> > > a database (A) as suggested in the "Re: join across databases". It did
> > > not give me any error
> > > nor it gave me any meaningful result. Any thought?
> > >
> > > Databases: A and B.
> > > Table in B: region_xref
> > >
> > > mysql> use A
> > > mysql> select * from B.region_xref where B.region_xref.main_id=20483
> > >     -> go
> > > Empty set (0.00 sec)                              <==== Did not work
> > > across database
> > >
> > > mysql> use B
> > > > Database changed
> > > mysql> select * from B.region_xref where B.region_xref.main_id=20483
> > >     -> go                                      <============= It
> works
> > > from the same database
> > > +---------+-----------+
> > > | main_id | region_id |
> > > +---------+-----------+
> > > |   20483 |         3 |
> > > |   20483 |        10 |
> > > |   20483 |         1 |
> > > |   20483 |         5 |
> > > |   20483 |         7 |
> > > |   20483 |         8 |
> > > +---------+-----------+
> > >
> > > The original email on the "Re: join across databases":
> > > >
> > > > "Subject:
> > > >           Re: join across databases?
> > > >      Date:
> > > >           Wed, 5 May 1999 21:45:14 -0700
> > > >      From:
> > > >           Thimble Smith <tim@stripped>
> > > >        To:
> > > >           Daevid Vincent <daywalker@stripped>, mySQL
> database
> > > > <mysql@stripped>
> > > >  References:
> > > >
> > > > On Wed, May 05, 1999 at 09:36:25PM -0700, Daevid Vincent wrote:
> > > > > Is it possible to join across databases?
> > > >
> > > > Yes, it is.  You can find the information in the manual.  In short,
> > > > you prefix the table name with the database name:
> > > >
> > > > SELECT l, p FROM db1.tableA, db2.tableB WHERE db1.tableA.m >
> > > > db2.tableB.q
> > > >
> > > > Tim"
> > >
> > > Thanks,
> > >
> > > Scott Liu
> >
> > Hi Scott
> >
> > Sorry, couldn't reproduce your problem :(
> >
> > Can you provide a full example?
> >
> > Tschau
> > Christian
> 
> --
> Scott Liu
> Software Developer
> 831 460 4300
> .....................................................................
> 
> TAPESTRY.NET - On Target, Online Recruiting
> 111 Mission St. Santa Cruz, CA 95060
> 
> Visit our web sites at:
> http://www.tapestry.net
> http://www.asia-net.com      Bilingual Professionals
> http://www.developers.net   Software Developers
> 
> 
> 
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread3550@stripped
> 
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.

-- 
Benjamin Pflugmann aka Philemon                       philemon@stripped
Programming, Guestbook support                voice: +49 941 94 65 939
SPiN GmbH             http://www.spin.de        fax: +49 941 94 65 938
======= Web design - Java chats - Guestbooks - Java/CGI coding =======
Thread
query on tables in second database when connection was made for first databaseScott Liu18 May
  • Re: query on tables in second database when connection was made for first databaseChristian Mack18 May
  • Cross Database queries (Re: query on tables in second database when connection was )Scott Liu19 May
    • Re: Cross Database queries (Re: query on tables in second database when connection was )Benjamin Pflugmann21 May