Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Views and multiple parameters
Message
De
17/06/1997 09:22:18
 
 
À
16/06/1997 16:15:10
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00036190
Message ID:
00036627
Vues:
36
>> converted it to a string and padded it to a fixed length. I had previously
>> PADR'd all my char calculated fields to a fixed length, but this numeric
>> one got by me!
>
>The old SQL indian trick (never heard of Escuella tribe?) for numeric
>calculated fields is to use
> 0000000000000.00+sum(whatever) as calcFieldName
>though it gives you the guaranteed widths, not the maximal widths - fox
>may decide that two decimal places may not be enough, depending on the
>complexity of the expression summed.

Thank You, I wondered if something like this would work.


>> option, and it worked fine! The only thing I did notice is that when you
>> are only SELECTing one table, it does not create a temp dbf, but rather
>> USEes AGAIN the base table, making it impossible to index. However, since
>> I don't have this problem (my view involves several tables) then I'll worry
>> about that later.
>
>No worry - you can't index it into the original table's .cdx, but try
>this:
>
>dx=_work+sys(3) && _work is full path to some temp dir
>sele * from any_table
>inde on any_field tag any_name of (dx)
>
>This way you create an independent index, in a separate file, and it's
>not considered a structural index, so it's not touching the table
>header.
>
>In the days of FP2.0 this wasn't exactly necessary, you could just
> inde on any_field tag any_name of temp
>....and it invariably created some 66743832.cdx, but on Novell 4.* and
>some other networks it started really creating temp.cdx, and put it to
>the app's dir, so the first time it was used simultaneously by two users
>it crashed.
>
>Moreover, if there was any crash while temp.cdx was open, it didn't get
>cleaned up. Next time the index was created, it wasn't created really;
>fox tried to reuse temp.cdx, which was probably well broken, and refused
>to work with it further on. After a regular close of the cursor, the
>temp.cdx would have been deleted. This workaround with using a (dx) to
>store a random file name seems to be a kludge - I remember I used it in
>the days of MFoxPlus, and was really relieved when in FPD2 I could
>forget about the temp index's file name. Then the problem came back.
>
Yes, I found that with the select(viewless) cursor that I generated, I could not create more than one index tag, nor could I change the tag once it was created, for the CDX file with the same temporary name as the cursor (I got a "read only file" error). This causes me to use the "index on whatever tag whatever of somefile" which file I have to erase when I'm done. With a view cursor I can create multiple indexes using the temp cdx filename, and it just goes away when I'm done, I don't have to erase it myself. So with these restrictions on select cursors, what is the advantage of using a select statement over a view? Are selects faster? Originally I was having troubles with parameters, but those problems have been solved, or at least I hope they have! So what is the advantage?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform