473,566 Members | 2,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

filter systables from ado recordset adSchemaTables (repost)

Hello,
I want to list all the user-tables of a DB2 database. I use the
ADO-openSchema method (adSchemaTables ), but I can't filter the
systables out.
Has someone any idea how to select only the user tables? (on a generic
way)
Regards,
Thijs

Nov 12 '05 #1
1 3750
On 2004-12-14, th**********@gm ail.com scribbled:
I want to list all the user-tables of a DB2 database. I use the
ADO-openSchema method (adSchemaTables ), but I can't filter the
systables out.
Has someone any idea how to select only the user tables? (on a generic
way)


Hi Thijs,

All the system tables, views, etc. exist within the SYSCAT, SYSIBM,
SYSFUN, and SYSSTAT schemas. Additionally, you are not permitted to
create any tables or views within these schemas:

"CREATE TABLE statement
....
table-name
Names the table. The name, including the implicit or explicit
qualifier, must not identify a table, view, nickname, or alias
described in the catalog. The schema name must not be SYSIBM, SYSCAT,
SYSFUN, or SYSSTAT (SQLSTATE 42939)..."

Ergo, if a table or view exists within any of these schemas, it is a
system table.

One final note of caution: I was once in a similar situation, having to
discern which tables were system tables in an application (to filter
them from the list given to end users), and decided to take a more
general approach.

On the basis of the following content from the DB2 SQL Reference:

"CREATE SCHEMA Statement
....
schema-name
Names the schema. The name must not identify a schema already described
in the catalog (SQLSTATE 42710). The name cannot begin with 'SYS'
(SQLSTATE 42939)..."

I decided that, since you cannot even create schemas that begin with
"SYS", it would be enough to check whether the schema for a given table
began with "SYS". If it did, it was a system table. However, this
turned out to be wrong.

Although one cannot _explicitly_ create a schema that begins with SYS,
one can do so _implicitly_. For example, this command will fail:

CREATE SCHEMA SYSTEST;

However, this command succeeds:

CREATE TABLE SYSTEST.TEST (A INTEGER NOT NULL);
HTH,

Dave.
--
Cogito cogito ergo cogito sum
-- Ambrose Bierce
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1139
by: thijs.kupers | last post by:
Hello, I want to list all the user-tables of a DB2 database. I use the ADO-openSchema method (adSchemaTables), but I can't filter the systables out. Has someone any idea how to select only the user tables? (on a generic way)
0
1174
by: thijs.kupers | last post by:
Hello, I want to list all the user-tables of a DB2 database. I use the ADO-openSchema method (adSchemaTables), but I can't filter the systables out. Has someone any idea how to select only the user tables? (on a generic way)
0
391
by: thijs.kupers | last post by:
Hello, I want to list all the user-tables of a DB2 database. I use the ADO-openSchema method (adSchemaTables), but I can't filter the systables out. Has someone any idea how to select only the user tables? (on a generic way)
3
1059
by: Gorilla | last post by:
I bound my package with EXPLAIN(YES), and it's got the following static SQL in it: EXEC SQL SELECT CARDF, RECLENGTH INTO :CARDF,:RECLENGTH FROM SYSIBM.SYSTABLES WHERE NAME = :TBNAME AND CREATOR = :TBCREATOR The explain shows that it does a *full table scan* on SYSIBM.SYSTABLES!
8
6518
by: dick | last post by:
I am just trying to print/report the results of a "filter by selection" which is done by right-clicking a form, filling in values, and "applying the filter." I have searched the newsgroups, and there are many examples. BUT, they fail sometimes. The techique is to pass the form's Me.filter as the "where condition" in a Docmd.openreport...
2
6670
by: Patrick Gonzalez | last post by:
Is it possible to use the built-in filter functions (ie. "Filter by Selection", etc..) when a form's recordsource has been set to a recordset object during the load event. When I try to do this, I receive the message "Cannot apply filter on one or more fields specified in the filter property". here is the code for the recordset creation: ...
2
6674
by: Thall | last post by:
Hey Gurus - I've seen a few solutions to this problem, but none of which I can do without a little help. Here's the situation The following code loops thru a sales report, using the sales rep ID as a filter so that multiple reports are created. This is now generating a PDF report, but I need to change it to RTF documents. My question is,...
11
49197
by: jason.teen | last post by:
Hi, I dont seem to be able to get this Filter right on my RecordSet for some reason. I have this code: Dim rs As Recordset Set rs = CurrentDb().OpenRecordset("SELECT DISTINCT Product,
0
2782
by: Troels Arvin | last post by:
Hello, I have a user who regularly runs a query which blocks a lot of other queries. The query is initiated from SSIS (SQL Server Integration Services) on another host. The DB2 instance is version 8.1. According to the user, the query doesn't perform any DROP TABLE/CREATE TABLE/... DDL-like actions. But it seems to perform a RUNSTATS at...
0
7666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8108
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.