MySQL Forums
Forum List  »  Newbie

Table References, Always db.table?
Posted by: Pon Keen
Date: October 07, 2018 03:08AM

It depends on your location in the database.

I will use just the describe as an example.

With DB name:
mysql> DESC information_schema.ENGINES;
+--------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| ENGINE | varchar(64) | NO | | | |
| SUPPORT | varchar(8) | NO | | | |
| COMMENT | varchar(80) | NO | | | |
| TRANSACTIONS | varchar(3) | YES | | NULL | |
| XA | varchar(3) | YES | | NULL | |
| SAVEPOINTS | varchar(3) | YES | | NULL | |
+--------------+-------------+------+-----+---------+-------+
6 rows in set (0.01 sec)


While in the Database:
mysql> use information_schema;
mysql> DESC ENGINES;
+--------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| ENGINE | varchar(64) | NO | | | |
| SUPPORT | varchar(8) | NO | | | |
| COMMENT | varchar(80) | NO | | | |
| TRANSACTIONS | varchar(3) | YES | | NULL | |
| XA | varchar(3) | YES | | NULL | |
| SAVEPOINTS | varchar(3) | YES | | NULL | |
+--------------+-------------+------+-----+---------+-------+
6 rows in set (0.01 sec)


If you are having trouble from your scripting level, then it is likely that your connection is in a different database or not one at all.

Just trying to help....

Options: ReplyQuote


Subject
Written By
Posted
Table References, Always db.table?
October 07, 2018 03:08AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.