Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Abnormal behavior of INLIST command
Message
De
27/06/2005 13:51:37
 
 
À
27/06/2005 12:36:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01026745
Message ID:
01026781
Vues:
14
Your problem most likely then was you were creating a string constant larger than 255 characters.

m_where =M_WHERE + ' and (field1 in (&mylist1) or field2 in (&mylist2)) '

You could have done this instead:
m_where =M_WHERE + ' and (field1 in (' + mylist1 + ')  or field2 in (' + mylist2 + ')) '
>Please disregard. I found the solution.
>The problem was in some prior statments.
>
>this does not work:
>m_where = " Where .t. "
>m_where =M_WHERE + ' and (field1 in (&mylist1) or field2 in (&mylist2)) '
>it qives the error:
>Command contains unrecognized phrase/keyword (Error 36)
>
>By breaking the statment in 2 lines, works:
>m_where = " Where .t. "
>m_where =M_WHERE + ' and (field1 in (&mylist1) '
>m_where =M_WHERE + ' or field2 in (&mylist2)) '
>
>
>
>>mylist1='"a1","a2 ",...,"a12"'
>>mylist2='"b1","b2 ",...,"b14"'
>>
>>It works: select * from mytable WHERE INLIST(field1,&mylist1 )
>>It works: select * from mytable WHERE INLIST(field2,&mylist2 )
>>It does not work:
>>select * from mytable WHERE (INLIST(field1,&mylist1 ) or INLIST(field2,&mylist2 ))
>>
>>However it works when the arquments in mylist1 and mylist2 are less than 6.
>>It is supposed that the arquments in the INLIST command can be up to 24
>>
>>Thanks,
>>Yiorgos
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform