some issues about storing variable lenght fields...

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

some issues about storing variable lenght fields...

Post by mrduck »

In a text-mode form I have 4 lines of 78 chars. The lines are indipendent (created by 4 @ GET commands) but they contain one long text. It happens that when the user need to add a word in the first line and the text doesn't fit, it is truncated and must be repeated at the start of the next line...

Porting this form to GUI I wondering which is the best way, since I also have to limit the char number (and i think I can do it) and the space on the printed form (and this is more difficult....)

I also created 4 fields in the database, char 78, TEXT1, TEXT2, TEXT3, TEXT4 = 312 bytes. This is lower than the standard 512 bytes of DBT file... about 70000 records * (512-312) = 14 MB saved...

Since a lot of these lines are empty I was thinking about normalizing the DB, creating a new dbf with fields:
DOCURECORD N 7
LINENUMB N 1
TEXT C 78
Index on docurecord, linenumb

Saving and retrieving the lines is done on the DBF, and only for not empty fields...

are there other possible solutions I can't foresse now ?
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: some issues about storing variable lenght fields...

Post by Rathinagiri »

I think this is rightly optimized.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: some issues about storing variable lenght fields...

Post by esgici »

Hi Francesco
mrduck wrote:This is lower than the standard 512 bytes of DBT file... about 70000 records * (512-312) = 14 MB saved...
...are there other possible solution?
Did you tried DBFFPT RDD ?

Does your method ( relating a second table ) is about first normalization ?

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: some issues about storing variable lenght fields...

Post by mrduck »

esgici wrote:Hi Francesco
mrduck wrote:This is lower than the standard 512 bytes of DBT file... about 70000 records * (512-312) = 14 MB saved...
...are there other possible solution?
Did you tried DBFFPT RDD ?
No, I didn't. I'm still using plain DBFNTX...
Does your method ( relating a second table ) is about first normalization ?
yes and no: "yes" since I'm applying that kind of normalizazion, "no" because the fields are not used in searches.. .actually I have a relation 1:m where m < 5 and I seem to remember that normalization can't be limited in this way... but ok, faded memory...
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: some issues about storing variable lenght fields...

Post by esgici »

Thanks to clarification

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
Post Reply