Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL - help
Message
 
À
15/10/1997 12:09:21
Shihchau Tai
Apic Systems Pte Ltd
Singapore, Singapour
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00054618
Message ID:
00054703
Vues:
36
>>>>ccommand = 'COPY TO ' + cfilename + ' FOR ' + THIS.cflagfield
>>>>&ccommand
>>>>
>>>>SELECT 0
>>>>USE (cfilename) ALIAS tmp1
>>>>ccommand = 'SELECT *,RECNO(ctblname) AS flagrecno FROM tmp1,' + ;
>>>> ctblname + ' WHERE tmp1.' + THIS.ckeyfield + '=' + ctblname + ;
>>>> '.' + THIS.ckeyfield + ' AND tmp1.'+ THIS.cseqfield + '=' + ;
>>>> ctblname + '.' + THIS.cseqfield + ;
>>>> ' INTO CURSOR mycursor'
>>>>&ccommand
>>>>
>>>>I have these commands to select records that are flagged from the buffer (table buffering mode). The RECNO doesn't seem to return the correct number. What is the problem and any idea how to overcome this?
>>>>
>>>>Thanks in advance.
>>>
>>>Tai, You're going to have problems whenever you use recno() in a SQL, particularly if you are pulling data from more than one table. The SQL code is not consistent on what record # it uses. You should be using a unique field or combination of fields to get your data.
>>>
>>>HTH
>>>Barbara
>>
>>Thx. I see your point. It was working fine when I select from one table if I am not on buffer mode.
>>
>> Is there any other way to get flag in the buffer? Also, is there a way to issue the command directly instead of going through a macro substitution?
>
>For the second question on the macro substitution, I found that I can issue 'COPY TO (cfilename) FOR EVAL(THIS.flagfield)'. What about the SQL? I don't seem to be able to apply EVAL on SQL.. Any suggestion?

Tai, I use macros in this situation myself, and haven't noticed any problems. Speed is much more dependent on proper indexes & Rushmore than on macros.

Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform