View previous topic :: View next topic
|
Author |
Message |
sumit agarwalla
New User
Joined: 13 Nov 2008 Posts: 17 Location: hyderabad
|
|
|
|
I have to create a table in which one of the fields is CITY of datatype CHAR(15).....and I have to use some sort of compressing the alphabetic field CITY ......how do I compress the field while creating it...please help me on this? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I have to use some sort of compressing the alphabetic field CITY |
You have received no replies because you have not posted anything for people to use to help you. . .
You need to define what you mean by "compress" and what the compression rules are for this requirement.
Post a variety of city names as they "are" and how you want them to be compressed. |
|
Back to top |
|
|
sumit agarwalla
New User
Joined: 13 Nov 2008 Posts: 17 Location: hyderabad
|
|
|
|
ok...i will explain what i require....
I need to create an employee table named "EMPLOYEEDET" with the following characteristics
Code: |
COLUMNNAME DATATYPE LENGTH REMARKS
dept_id numeric 4 foreign key which refers the
corresponding column in the
parent table "DEPARTMENT"
emp_no numeric 4 primary key
firstname alphabetic 15
lastname alphabetic 15
city alphabetic 15 use some sort of compressing the
alphabetic field city
gender alphabetic 1 gender should be M or F.it should not
allow to enter any other character
other than M and F
age NUmeric 4
salary numeric integer:8
decimal:2
doj date 10 |
now i just have to create the table with following remarks being followed but i am not able to understand the remark of the city field. what does it mean?
what i did next to go forward was first i created the table with city fields datatype as CHAR and later on altered the table by changing the datatype from CHAR TO VARCHAR which I think will occupy less space then CHAR.Suggest me if I am wrong. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Sumit,
My suggestion can be, create a table called CITY containing city_code CHAR(4) & city_nameCHAR(30). In this table use city_code CHAR(4).
CHAR TO VARCHAR : Depends on the REQUIREMENT.
Sushanth |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
use some sort of compressing the
alphabetic field city
|
Basically - nonsense. . . "Some sort of compressing" is incredibly poor direction.
Quote: |
later on altered the table by changing the datatype from CHAR TO VARCHAR which I think will occupy less space then CHAR. |
A small amount of space might be saved, but keep in mind it would be a small amount. |
|
Back to top |
|
|
|