Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Long strings?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00906915
Message ID:
00907046
Views:
12
Hi Dale,

I read through the thread, and I hope that I understood your need. You want to store strings of 1024 characters, and be able to search for an exact match later? Easy! Here is an example with testdata. Note that this process is Rushmore optimized!
CREATE TABLE LONGSTR (txtpart1 c(225), txtpart2 c(225), txtpart3 c(225), txtpart4 c(225), txtpart5 c(124))
INDEX ON txtpart1 TAG txtpart1
INDEX ON txtpart2 TAG txtpart2
INDEX ON txtpart3 TAG txtpart3
INDEX ON txtpart4 TAG txtpart4
INDEX ON txtpart4 TAG txtpart5
* lcLong is your string, the loop is to create test data
FOR y=32 TO 100 && create test data
   lcLong=""
   FOR x=1 TO 1024
      lcLong = lcLong + CHR(y+(x%64))
   ENDFOR 
* the next line is vital!
   INSERT INTO LONGSTR (txtpart1,txtpart2,txtpart3,txtpart4,txtpart5) values;
      (LEFT(lcLong,225),;
      SUBSTR(lcLong,226,225),;
      SUBSTR(lcLong,451,225),;
      SUBSTR(lcLong,671,225),;
      SUBSTR(lcLong,901))
ENDFOR 
* now to test the search
lcLong="" && your search string, here we create a dummy string to search for
FOR x=1 TO 1024 
  lcLong = lcLong + CHR(50+(x%64))
ENDFOR 
* the next line IS Rushmore optimized!
LOCATE FOR txtpart1=LEFT(lcLong,225);
   AND txtpart2=SUBSTR(lcLong,226,225);
   AND txtpart3=SUBSTR(lcLong,451,225);
   AND txtpart4=SUBSTR(lcLong,671,225);
   AND txtpart5=SUBSTR(lcLong,901)
>I have to store a string that is 1024 bytes (1K) in size. I would love it store them in a table and index them, but the only way I can think to do this is store the string in chunks of 254 bytes. Then I would have to put them back together in order to get the orginal string. Plus I have a problem creating that long of index.
>
>I know I can store them in memo fields, but those do no tend real well to indexing. I thought about memo binary, but the same problem. I thought about general, but ran into same types of issues. I know I can store a pointer to a text file and read them out of there, but no real way to index these.
>
>Does anyone have an idea I am overlooking? Is there a better way of storing and indexing these strings?
>
>Thanks,
>Dale
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform