Gossamer Forum
Home : Products : Others : MySQLMan :

Wildcard for Table Names

Quote Reply
Wildcard for Table Names
I am trying to use the SQL Monitor to DROP all tables within a database, but not delete or DROP the whole database.

I've tried using:

Code:

DROP TABLE tbl_AG_'%'


AND

Code:

DROP TABLE tbl_AG_'\%'


AND

Code:

DROP TABLE 'tbl_AG_\%'


I've searched the http://www.mysql.com web site and read most of the DROP syntax tutorials. It doesn't seem like MySQL supports wildcard characters within table names.

Anyone know if it is possible to include wildcard characters in table names????

Individually DROPping 40 tables in a database is a pain!

Thanks in advance....

Regards,

Eliot Lee
Quote Reply
Re: Wildcard for Table Names In reply to
Do you not need to use '*' ?

Installs:http://www.wiredon.net/gt/
MODS:http://wiredon.net/gt/download.shtml

Quote Reply
Re: Wildcard for Table Names In reply to
Tried that...the wildcard character for MySQL is %, Paul.

Regards,

Eliot Lee
Quote Reply
Re: Wildcard for Table Names In reply to
Yeah but as you said, you tried it yourself so you must also have thought there was a chance it may work.

Installs:http://www.wiredon.net/gt/
MODS:http://wiredon.net/gt/download.shtml

Quote Reply
Re: Wildcard for Table Names In reply to
Originally, yes, but after researching MySQL web site, I found out that the * character does not work...and the appropriate wildcard character is %.

Anyway, if anyone knows a solution for my problem, I would appreciate some guidance or suggestions.

Thanks for trying, Paul...

Regards,

Eliot Lee
Quote Reply
Re: Wildcard for Table Names In reply to
Have you tried...

DROP TABLE tbl_AG_%

and

DROP TABLE 'tbl_AG_%'



??





Installs:http://www.wiredon.net/gt/
MODS:http://wiredon.net/gt/download.shtml

Quote Reply
Re: Wildcard for Table Names In reply to
No forget them they don't work.

Installs:http://www.wiredon.net/gt/
MODS:http://wiredon.net/gt/download.shtml

Quote Reply
Re: Wildcard for Table Names In reply to
Yep...didn't work.

Regards,

Eliot Lee