473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Detecting RI datatype mismatches

BD
Hi, all.

I'm running 8.2 on Windows.

This is a development platform for a project whose production
environment is running on a mainframe.

I believe that the RI compilation process is not quite as robust on
Windows as it is in other environments. Here's what I'm finding:

The data model is being maintained in ERwin.

I create a couple of tables, and establish an FK in TABLE_1 against
the PK of TABLE_2.

I then change the datatype of the FK column in TABLE_1. Erwin allows
this (YUCK). ((I also find that if I change the datatype of the parent
column, propagation of that change to the child(ren) seems pretty
spotty - sometimes it happens, sometimes not.))

I spit out the DDL, and run it. No errors are generated. So I now have
a child column whose datatype differs from the parent, and yet the
constraint compiles.

I'm rather concerned about this, as I have some indication that
problems like this won't be caught in the Windows environments at all,
but will cause errors when the DDL code goes to Production.

My background is Oracle, and I could see where I'd be able to generate
some PL/SQL in Oracle, using a cursor or two, to check for datatype
mismatches like this so they can be corrected in the ERwin model.
Would there be some equivalent system views in db2 that I could look
at for helpful RI details? Views that would include tables and columns
that are involved with FK constraints, and datatypes of specific
columns?

Thanks!!

BD

Oct 29 '07 #1
11 1867

BD wrote:
Hi, all.

I'm running 8.2 on Windows.

This is a development platform for a project whose production
environment is running on a mainframe.

I believe that the RI compilation process is not quite as robust on
Windows as it is in other environments. Here's what I'm finding:

The data model is being maintained in ERwin.

I create a couple of tables, and establish an FK in TABLE_1 against
the PK of TABLE_2.

I then change the datatype of the FK column in TABLE_1. Erwin allows
this (YUCK). ((I also find that if I change the datatype of the parent
column, propagation of that change to the child(ren) seems pretty
spotty - sometimes it happens, sometimes not.))

I spit out the DDL, and run it. No errors are generated. So I now have
a child column whose datatype differs from the parent, and yet the
constraint compiles.

I'm rather concerned about this, as I have some indication that
problems like this won't be caught in the Windows environments at all,
but will cause errors when the DDL code goes to Production.

My background is Oracle, and I could see where I'd be able to generate
some PL/SQL in Oracle, using a cursor or two, to check for datatype
mismatches like this so they can be corrected in the ERwin model.
Would there be some equivalent system views in db2 that I could look
at for helpful RI details? Views that would include tables and columns
that are involved with FK constraints, and datatypes of specific
columns?
Can you reproduce this with only two tables and post the script
generated from Erwin?

/Lennart

Oct 30 '07 #2
On Oct 30, 3:07 am, Lennart <Erik.Lennart.Jons...@gmail.comwrote:
BD wrote:
Hi, all.
I'm running 8.2 on Windows.
This is a development platform for a project whose production
environment is running on a mainframe.
I believe that the RI compilation process is not quite as robust on
Windows as it is in other environments. Here's what I'm finding:
The data model is being maintained in ERwin.
I create a couple of tables, and establish an FK in TABLE_1 against
the PK of TABLE_2.
I then change the datatype of the FK column in TABLE_1. Erwin allows
this (YUCK). ((I also find that if I change the datatype of the parent
column, propagation of that change to the child(ren) seems pretty
spotty - sometimes it happens, sometimes not.))
I spit out the DDL, and run it. No errors are generated. So I now have
a child column whose datatype differs from the parent, and yet the
constraint compiles.
I'm rather concerned about this, as I have some indication that
problems like this won't be caught in the Windows environments at all,
but will cause errors when the DDL code goes to Production.
My background is Oracle, and I could see where I'd be able to generate
some PL/SQL in Oracle, using a cursor or two, to check for datatype
mismatches like this so they can be corrected in the ERwin model.
Would there be some equivalent system views in db2 that I could look
at for helpful RI details? Views that would include tables and columns
that are involved with FK constraints, and datatypes of specific
columns?

Can you reproduce this with only two tables and post the script
generated from Erwin?

/Lennart
yes...syscat. sysrels or sysibm.sysrels The first one is a view and
the second is a real catalog table.

HTH

Roger

Oct 31 '07 #3
Roger wrote:
the second is a real catalog table.
.... which you shouldn't use if you prefer stable applications.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Oct 31 '07 #4
On Oct 31, 3:15 am, Roger <wondering...@gmail.comwrote:
[...]
Can you reproduce this with only two tables and post the script
generated from Erwin?
/Lennart

yes...syscat. sysrels or sysibm.sysrels The first one is a view and
the second is a real catalog table.
I dont follow, and I dont see any output from Erwin.

/Lennart
Oct 31 '07 #5
BD wrote:
Hi, all.

I'm running 8.2 on Windows.

This is a development platform for a project whose production
environment is running on a mainframe.
"mainframe" is somewhat ambiguous these days, as it can run different OS's.
If your production environment will be running Linux on zSeries, having a
dev environment on Windows is more or less OK, as both will be running "DB2
for LUW".
However if your prod environment is running zOS, you should be aware that
"DB2 for zOS" isn't the same product as "DB2 for LUW" (different
architecture; differences in DDL and system tables/views; other utilities
etc.)

HTH

--
Jeroen
Oct 31 '07 #6
BD
On Oct 31, 2:56 pm, "The Boss" <use...@No.Spam.Please.invalidwrote:
BD wrote:
Hi, all.
I'm running 8.2 on Windows.
This is a development platform for a project whose production
environment is running on a mainframe.

"mainframe" is somewhat ambiguous these days, as it can run different OS's.
If your production environment will be running Linux on zSeries, having a
dev environment on Windows is more or less OK, as both will be running "DB2
for LUW".
However if your prod environment is running zOS, you should be aware that
"DB2 for zOS" isn't the same product as "DB2 for LUW" (different
architecture; differences in DDL and system tables/views; other utilities
etc.)

HTH

--
Jeroen
Yes, and the distinctions are many. However, the client's handling all
the necessary processes to run the builds in the Prod environment
(it's zOS).

Nov 1 '07 #7
BD
On Oct 30, 7:15 pm, Roger <wondering...@gmail.comwrote:
On Oct 30, 3:07 am, Lennart <Erik.Lennart.Jons...@gmail.comwrote:


BD wrote:
Hi, all.
I'm running 8.2 on Windows.
This is a development platform for a project whose production
environment is running on a mainframe.
I believe that the RI compilation process is not quite as robust on
Windows as it is in other environments. Here's what I'm finding:
The data model is being maintained in ERwin.
I create a couple of tables, and establish an FK in TABLE_1 against
the PK of TABLE_2.
I then change the datatype of the FK column in TABLE_1. Erwin allows
this (YUCK). ((I also find that if I change the datatype of the parent
column, propagation of that change to the child(ren) seems pretty
spotty - sometimes it happens, sometimes not.))
I spit out the DDL, and run it. No errors are generated. So I now have
a child column whose datatype differs from the parent, and yet the
constraint compiles.
I'm rather concerned about this, as I have some indication that
problems like this won't be caught in the Windows environments at all,
but will cause errors when the DDL code goes to Production.
My background is Oracle, and I could see where I'd be able to generate
some PL/SQL in Oracle, using a cursor or two, to check for datatype
mismatches like this so they can be corrected in the ERwin model.
Would there be some equivalent system views in db2 that I could look
at for helpful RI details? Views that would include tables and columns
that are involved with FK constraints, and datatypes of specific
columns?
Can you reproduce this with only two tables and post the script
generated from Erwin?
/Lennart

yes...syscat. sysrels or sysibm.sysrels The first one is a view and
the second is a real catalog table.

HTH

Roger- Hide quoted text -

- Show quoted text -
Thanks. I'll have a look.

Nov 1 '07 #8
BD
On Oct 30, 1:07 am, Lennart <Erik.Lennart.Jons...@gmail.comwrote:
BD wrote:
Hi, all.
I'm running 8.2 on Windows.
This is a development platform for a project whose production
environment is running on a mainframe.
I believe that the RI compilation process is not quite as robust on
Windows as it is in other environments. Here's what I'm finding:
The data model is being maintained in ERwin.
I create a couple of tables, and establish an FK in TABLE_1 against
the PK of TABLE_2.
I then change the datatype of the FK column in TABLE_1. Erwin allows
this (YUCK). ((I also find that if I change the datatype of the parent
column, propagation of that change to the child(ren) seems pretty
spotty - sometimes it happens, sometimes not.))
I spit out the DDL, and run it. No errors are generated. So I now have
a child column whose datatype differs from the parent, and yet the
constraint compiles.
I'm rather concerned about this, as I have some indication that
problems like this won't be caught in the Windows environments at all,
but will cause errors when the DDL code goes to Production.
My background is Oracle, and I could see where I'd be able to generate
some PL/SQL in Oracle, using a cursor or two, to check for datatype
mismatches like this so they can be corrected in the ERwin model.
Would there be some equivalent system views in db2 that I could look
at for helpful RI details? Views that would include tables and columns
that are involved with FK constraints, and datatypes of specific
columns?

Can you reproduce this with only two tables and post the script
generated from Erwin?

/Lennart- Hide quoted text -

- Show quoted text -
In short, yes.

But there's nothing exotic (or even post-worthy, IMO) about the DDL
that's generated from Erwin; It's simple create statements. It's just
that the child FK column remains defined as the same as it had been
before the parent's datatype was changed.

I'm not an ERwin expert, but I've been advised that ERwin should not
be expected to propagate such datatype changes from parent to child.
Which would be fine, except for the fact that I've seen situations
where the propagation occurs - and some where it does not.

Nov 1 '07 #9
On Nov 1, 6:43 pm, BD <robert.d...@gmail.comwrote:
[...]
But there's nothing exotic (or even post-worthy, IMO) about the DDL
that's generated from Erwin; It's simple create statements. It's just
that the child FK column remains defined as the same as it had been
before the parent's datatype was changed.
What's interesting is whether db2 accepts it or not

/Lennart

[...]

Nov 2 '07 #10
Lennart wrote:
On Nov 1, 6:43 pm, BD <robert.d...@gmail.comwrote:
[...]
>But there's nothing exotic (or even post-worthy, IMO) about the DDL
that's generated from Erwin; It's simple create statements. It's just
that the child FK column remains defined as the same as it had been
before the parent's datatype was changed.

What's interesting is whether db2 accepts it or not
I haven't followed all of your discussion, but DB2 allows a different data
type in referencing tables than in the referenced table:

$ db2 "create table a ( a int not null primary key )"
DB20000I The SQL command completed successfully.
8 local:~/ $ db2 "create table b ( a smallint, foreign key(a) references
a )"
DB20000I The SQL command completed successfully.

And I don't see a particular reason why this should not be allowed...

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Nov 5 '07 #11
On Nov 5, 1:27 pm, Knut Stolze <sto...@de.ibm.comwrote:
[...]
$ db2 "create table a ( a int not null primary key )"
DB20000I The SQL command completed successfully.
8 local:~/ $ db2 "create table b ( a smallint, foreign key(a) references
a )"
DB20000I The SQL command completed successfully.

And I don't see a particular reason why this should not be allowed...
Neither do I as long as they are eqtypes. Anyhow, I suspect that the
problem lies within Erwin and has nothing to do with db2. Still, I can
understand the OP's worry about what will happen on the mainframe
Nov 5 '07 #12

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

Similar topics

3
by: Lorenzo Bolognini | last post by:
Hi all, i'd like to know if there is some way to detect whether a field is of type MEMO (i'm using MS Access) so to behave accordingly placing a textarea instead of a textbox in the UI. Thank...
8
by: Eternally | last post by:
Hi folks, I've got a program which has a function which uses templates to accept parameters of any type. Works well, but there's one certain datatype which I want to special case and do an...
4
by: Gary | last post by:
I recently joined a project with a mix of K&R C and ANSI C++. There are instances of prototype mismatches defined in one file and used in another that aren't being caught and result in run time...
0
by: SoYouKnowBrig | last post by:
Hi All, I am using Microsoft.ApplicationBlocks.Cache.CacheManager to persist a System.Data.Dataset object. This Dataset object has a DataTable that is created from an existing DataTable using...
3
by: Sri | last post by:
In VB, to know the field type of a column stored in a recordset the command I use is If rsQuery.Fields(k).Type = adCurrency Then How will I achieve the same in ASP.net. I could not find a...
79
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the...
4
by: Orchid | last post by:
How can I change a Date datatype to a Number datatype? For example, I want a date 10/31/2006 to show 1031 as Number datatype. But I don't want it becomes 39021. What formula should I use? ...
3
by: DragonLord | last post by:
I want to know how you find out if a variable contains an null value in c# I know for the string you have the string.isnullorempty but what about integer etc... is there somewhere i can look...
2
by: marybrown | last post by:
i will write the complete problem i am facing. Here is the input file i am using. sxoght: #query hit score probability qstart qend qorientation tstart tend matches mismatches...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.