Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

large character field

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
HOW CAN I GET A 500 CHARS. IN A CHARACTER FIELD?. I DONT WANT A MEMO FIELD. DBCREATE() CREATES 254 CHARS MAX, AND THE LITERATURE SAY THAT CHAR FIELDS CAN BE TO 64K.
I APPRECIATE YOUR HELP
JEAN LOU
 
you have to use a memo field to get that length.
why your hesitation to use a memo field?
 

The Clipper Help file lists this under DBCREATE():

aDbf := {}
AADD(aDbf, { "Name", "C", 25, 0 })
AADD(aDbf, { "Address", "C", 1024, 0 })
AADD(aDbf, { "Phone", "N", 13, 0 })
//
DBCREATE("People", aDbf)


So you can have large character fields.

However, unless you are going to use the full length in each record, I would not recommend using them as the file will be quite large because the full, 1024 in the sample, size of the field is allocated for each record.

I have tested the above sample and it works fine within Clipper, but when I opened the file with FoxPro, the Address and Phone fields were not accessed correctly, so there appears to be compatibility problems with other products.

Use with caution.

Hope this helps,
HotEye
 
Including extra large fields in databases really doesn't make sense. EVERY record will consume realestate. If you need really large character fields for SOME records, simply create another SEPARATE dbf with stru of field->key, n,4,0..
and field->text, C, 500 <or whatever>, & index on key
Simply put the record number of main database record in the key field and whatever text etc. required in the chr field. You can have as many as you like relating to any particular record in the primary database. Primary database remains compact, large fields restricted to index secondary database only for requiring that much space, and you are not limited to your 500 chrs.

Just a thought
 
LesRedding's solution is another method, but, personally, I would not advise using the record number as the link.

Use a key field or add a numeric field to the main db with a counter for the link reference.

The use of the record number will stop you from packing the main file to remove deleted records.

HotEye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top