Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with SELECT
Message
De
05/08/2011 12:51:26
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01520239
Message ID:
01520252
Vues:
47
I tried it with an alias in the query and got the same result. I think Naomi got by using macro substitution in place of the eval.


>The 'current.sc1_2000' in the second case references original table/cursor alias not the one used in the query. See http://www.berezniker.com/content/pages/visual-foxpro/queries-and-functions-which-accept-alias-parameter
>
>>Thanks Sergey -
>>With ANSI OFF, this produces 4 records (the correct answer).
>>
>>SELECT st_name, Current.* ;
>>FROM tipdatabase!tip T ;
>>INNER JOIN tipdatabase!current  ;
>>ON t.tip_id = current.tip_id ;
>>WHERE ALLTRIM(current.sc1_2000) == "STP"
>>
>>But this
>>
>>thisfield = 'current.sc1_2000'
>>
>>SELECT st_name, Current.* ;
>>FROM tipdatabase!tip T ;
>>INNER JOIN tipdatabase!current  ;
>>ON t.tip_id = current.tip_id ;
>>WHERE ALLTRIM(eval(thisfield)) == "STP"
>>
>>Produces no records. Same result with ANSI on.
>>
>>
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform