View previous topic :: View next topic
|
Author |
Message |
juares castro
New User
Joined: 04 May 2012 Posts: 34 Location: Brazil
|
|
|
|
Hi everyone!
Could we use LOW VALUES as a key in DB2 table?
We have a flat file we use to REPRO to a VSAM file, but we will convert our system to Linux/Java and need to use now DB2 tables. First record has different information and it has in first 11 bytes as LOW VALUES as a key.
Thanks in advance. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
You could have tried it to see what happened. This is the best way to learn anything. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
nowhere in the manuals for any data-base/data-management system
there are warnings abut the allowed/forbidden values of a key |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
LOW-VALUES can be anything.
When you say Key, I take it as Primary Key in DB2 then Nulls are not allowed. |
First, LOW-VALUES is a COBOL term that refers to a field with all bits set to 0 -- X'0000.....00' (however long it is). It CANNOT be "anything" -- it is a specific bit pattern and only that bit pattern.
Second, LOW-VALUES are not NULL. NULL requires a separate field from the data to denote that the field is NULL. Even if the data field is LOW-VALUES, that does not mean the value is NULL -- only having the indicator field set will mean the value is NULL. |
|
Back to top |
|
|
juares castro
New User
Joined: 04 May 2012 Posts: 34 Location: Brazil
|
|
|
|
Thanks to everyone!
And, Phrzby Phil, my understanding about the forum is share what we know and about our experience to help anybody. Indeed I could try first, but I have chosen searching here. It is a good manner to me to learn something. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Juares -
I certainly agree with your comments about sharing. My intention is merely to encourage anyone new to technology (and this includes experts on this excellent forum who may from time to time be using certain tools for the first time) to learn as much as possible by experimenting. The lessons will stick much more rapidly and solidly this way.
When I was getting more involved with DB2, I had a sandbox set up for me where I could play around and try all kinds of stuff (e.g., experimenting with the so-called null indicator - "so-called" because if I remember, it indicates other stuff as well. Anyone wanting to clarify this please do.)
This also provided me with a collection of experiments and tests i could then build on and share with my team.
I'm retired now, but I wish you Good Luck and Happy Hunting.
Live Long and Prosper. |
|
Back to top |
|
|
juares castro
New User
Joined: 04 May 2012 Posts: 34 Location: Brazil
|
|
|
|
Thanks Phrzby Phil !
Long life for You too. |
|
Back to top |
|
|
juares castro
New User
Joined: 04 May 2012 Posts: 34 Location: Brazil
|
|
|
|
As I said before, we will convert our process to JAVA/LINUX and the current file is a VSAM, that is not supported in LINUX. And in this file first record has LOW-VALUES (X'0000...00') as key. That was my question. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
as already told ...
the data(base) management systems DO NOT CARE about the values of the keys
so any discussion why the TS want to use a "low value" is just a completely waste of time.
the topic has been pruned of the irrelevant posts |
|
Back to top |
|
|
juares castro
New User
Joined: 04 May 2012 Posts: 34 Location: Brazil
|
|
|
|
Enrico, i was just responding Phrzby Phi. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I was not commenting Your posts,
but the posts of the people questioning the why of a key containing low values |
|
Back to top |
|
|
|