By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,130 Members | 2,141 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,130 IT Pros & Developers. It's quick & easy.

views and db2look

P: n/a
One of the databases has 50 views and when I do a db2look I only get
schema for 40 of them. If I select from the sysviews, I can see all 50
(the text column contains schema for all 10 (missing) views). What's
going on here? Why can't or how can I get the schema for these 10
views.

Aix 5.1 V7.2 EE FP9

Thanks.
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Ian
dbtoo_dbtoo wrote:
One of the databases has 50 views and when I do a db2look I only get
schema for 40 of them. If I select from the sysviews, I can see all 50
(the text column contains schema for all 10 (missing) views). What's
going on here? Why can't or how can I get the schema for these 10
views.

Aix 5.1 V7.2 EE FP9

Thanks.


How are you running db2look?

If you are extracting DDL for a specific schema (-z) or definer (-u),
then db2look will include DDL for the views that depend on the tables
you are extacting.

For example, if you have a schema 'USER1' that has 5 tables, and a
view that does not reference any of the USER1 tables, then executing

db2look -e -z user1

Will NOT include the view.

To get all views in the database, you need to run db2look -e -a, or
specify the appropriate table schema. (I know, this is a pain).

Good luck,

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #2

P: n/a
Can you post the syntax of the db2look command? What do the 10 views
have in common that differentiates them from the other 40? Have you
checked the valid flag in syscat.views:

select viewname, valid from syscat.views

dbtoo_dbtoo wrote:
One of the databases has 50 views and when I do a db2look I only get
schema for 40 of them. If I select from the sysviews, I can see all 50
(the text column contains schema for all 10 (missing) views). What's
going on here? Why can't or how can I get the schema for these 10
views.

Aix 5.1 V7.2 EE FP9

Thanks.


Nov 12 '05 #3

P: n/a
Blair Adamache <ba*******@2muchspam.yahoo.com> wrote in message news:<c0**********@hanover.torolab.ibm.com>...
Can you post the syntax of the db2look command? What do the 10 views
have in common that differentiates them from the other 40? Have you
checked the valid flag in syscat.views:

select viewname, valid from syscat.views

dbtoo_dbtoo wrote:
One of the databases has 50 views and when I do a db2look I only get
schema for 40 of them. If I select from the sysviews, I can see all 50
(the text column contains schema for all 10 (missing) views). What's
going on here? Why can't or how can I get the schema for these 10
views.

Aix 5.1 V7.2 EE FP9

Thanks.


Here is the syntax:
db2look -d mydb -o mydb.ddl -e -x -l -z myschema

i did check sysviews. The other 10 (missing) views have 'mychema' as
owner/schema name and valid field of syscat.sysviews is Y, not X.

I got the schema for one of the views from text column of
syscat.sysviews and manually recreated it and did another db2look as
above -- same story. It does not show up in the ddl output and valid
field shows Y.

Thanx.
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.