PDA

View Full Version : droping new tables


jstacruz
03-12-02, 12:48
Got problem droping tables. Our application inserts new table in our database once a users has a successfull logon on the application. Now when I run "info" from dbaccess, table menu tab it list all the tables in the database including the new tables created by the application.

These new tables are accumulating everyday. Meaning every users logon is equavalent to one table and informix assgins unique name but always starts with something like "btv_". So we wanted to create a script that will drop those tables. I have this sql script just to list the new tables but when I run this sql script it doesnt find the new tables. Here's the sql script

select database sysmaster
select tabname from systabnames
where dbsname = "dbname" and tabname = "btv_%"
order by tabname

btv_% is just a wildcard to filter all tables that start with this name. Unfornately it wont show when you run the script. Is every databases has it's own sysmaster? Am I missing something here?

THanks a lot
Joey

BFG
03-13-02, 10:52
Hope I can help.
Is every databases has it's own sysmaster? No, one sysmaster for all the database.

Try this:

select database {your database} (not sysmaster)
select tabname from systables
where tabname = "btv_%"
order by tabname

What you are looking for is the "System Catalog Tables". Every database has the own system tables. One sysmaster for all databases.


:)