Rechercher dans le manuel MySQL
27.4.4.26 The table_exists() Procedure
Tests whether a given table exists as a regular table, a
TEMPORARY
table, or a view. The procedure
returns the table type in an OUT
parameter.
If both a temporary and a permanent table exist with the given
name, TEMPORARY
is returned.
Parameters
in_db VARCHAR(64)
: The name of the database in which to check for table existance.in_table VARCHAR(64)
: The name of the table to check the existance of.out_exists ENUM('', 'BASE TABLE', 'VIEW', 'TEMPORARY')
: The return value. This is anOUT
parameter, so it must be a variable into which the table type can be stored. When the procedure returns, the variable has one of the following values to indicate whether the table exists:''
: The table name does not exist as a base table,TEMPORARY
table, or view.BASE TABLE
: The table name exists as a base (permanent) table.VIEW
: The table name exists as a view.TEMPORARY
: The table name exists as aTEMPORARY
table.
- Query OK, 1 row affected (0.01 sec)
- Database changed
- Query OK, 0 rows affected (0.03 sec)
- Query OK, 0 rows affected (0.20 sec)
- Query OK, 0 rows affected (0.02 sec)
- Query OK, 0 rows affected (0.00 sec)
- Query OK, 0 rows affected (0.01 sec)
- +-----------+
- +-----------+
- +-----------+
- Query OK, 0 rows affected (0.02 sec)
- +------------+
- +------------+
- +------------+
- Query OK, 0 rows affected (0.02 sec)
- +---------+
- +---------+
- +---------+
- Query OK, 0 rows affected (0.00 sec)
- +---------+
- +---------+
- | |
- +---------+
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-sys-table-exists.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.