What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » SQl querys: getting table names

SQl querys: getting table names
Author: Message:
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
O.P. SQl querys: getting table names
I am trying to figure out what tables are available on a particular database. I have read access to the whole database, through an html form to input queries. Is it possible to query a list of available tables?
code:
example: Select * from BaseTable.Table where ....
I have BaseTable, I am trying to figure out all of the Table names

This post was edited on 09-29-2006 at 03:53 PM by MeEtc.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
09-29-2006 03:51 PM
Profile PM Web Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: SQL querys: getting table names
SHOW TABLES FROM DatabaseName

(That works in MySQL, anyway)

This post was edited on 09-29-2006 at 04:14 PM by WDZ.
09-29-2006 04:12 PM
Profile PM Web Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
O.P. RE: SQl querys: getting table names
Error: your query must have a select statement.

there's a error detect in place, ya need a select and where clause

This post was edited on 09-29-2006 at 04:17 PM by MeEtc.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
09-29-2006 04:15 PM
Profile PM Web Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: SQL queries: getting table names
Well, I dunno if it's possible to list the tables if you can only run SELECT queries... hmm... :-/
09-29-2006 04:19 PM
Profile PM Web Find Quote Report
Adeptus
Senior Member
****


Posts: 732
Reputation: 40
Joined: Oct 2005
RE: SQl querys: getting table names
What is the database (e.g. MySQL, MS SQL) and what are you using to query it with?

Using MS SQL, you can select the table names from sysobjects system table -- I would have to look in the docs to see what you need in your where clause to limit the results to just tables (and not also views, etc).
09-29-2006 05:00 PM
Profile E-Mail PM Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
O.P. RE: SQl querys: getting table names
its MySQL on a java/tomcat server
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
09-29-2006 05:12 PM
Profile PM Web Find Quote Report
Adeptus
Senior Member
****


Posts: 732
Reputation: 40
Joined: Oct 2005
RE: SQl querys: getting table names
http://dev.mysql.com/doc/refman/5.0/en/information-schema.html

Unfortunately, with MySQL 4.x and older, you are out of luck if you can't use SHOW.
09-29-2006 05:18 PM
Profile E-Mail PM Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
O.P. RE: SQl querys: getting table names
sorry to bring back a thread....

is it possible to embed this as a subquery? I tried
select * from (show tables from database where table is not null) where table is not null
but that gives a "no 'where' clause found" error
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
10-19-2006 05:24 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On