Re: separate columns or separate table? - databases
This is a discussion on Re: separate columns or separate table? - databases ; Frank, > acct_nbr DECIMAL(10) NOT NULL - Most of our account numbers are ten decimal digits, which is why I chose this. *What do you think is strange aboutit? There are no digits after comma, so I would rather see ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| > acct_nbr DECIMAL(10) NOT NULL - Most of our account numbers are ten decimal digits, which is why I chose this. *What do you think is strange aboutit? < There are no digits after comma, so I would rather see this as INTEGER or CHAR(10) - depending on the requirements for your account number. > Mandatory as in "can't create the table without it" or as in "highly recommended, but not actually enforced by the database"? *I'm guessing the later, because in DB2 I am definitely able to create a table that does not have a PK. < The later. Even first normal form requires the table to have a primary key. You could not reliably access a row without and you can not prevent duplicated insertions in that table destroying your query results then. Regarding your multiple insertion question it came in my mind that DB2 has the ability to accept a single statement like: INSERT INTO Calltrak.Call_Segments (call_id, service_code, acct_nbr) VALUES (1, 'A', 1234567890), (1, 'A', 1234567890), (1, 'B', 1234567890), (1, 'C', 1234567890), (1, 'D', 1234567890); Not sure if this helps, but might be worth a try. Also service_code might become a bit short with CHAR(1) if the variety of services grows. CHAR(3) for example would give more room for growth. brgds Philipp Post |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 12:07 PM.




Linear Mode