Page 1 of 1

some issues about storing variable lenght fields...

Posted: Wed Jan 18, 2012 2:28 pm
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 ?

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

Posted: Wed Jan 18, 2012 2:59 pm
by Rathinagiri
I think this is rightly optimized.

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

Posted: Wed Jan 18, 2012 4:49 pm
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

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

Posted: Wed Jan 18, 2012 9:36 pm
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...

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

Posted: Wed Jan 18, 2012 9:49 pm
by esgici
Thanks to clarification

Regards

--

Esgici