Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multi-Parameterized Remote View
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Multi-Parameterized Remote View
Divers
Thread ID:
00023255
Message ID:
00023255
Vues:
70
Hello All,

I work now on Client-Server app in VFP 3.0b, with Sybase as a back-end.
We are trying to use one parameterized view for 3 different objects in app. We found that we cannot get what we want from remote view, which SQL statement
looks like:
SELECT * FROM myTable WHERE myCodeField IN ?myCodeVariable
and in this particular case
myCodeVariable = "'AAAA','BBBB','CCCC'"
At the same time it is possible to substitute this myCodeVariable into SQLEXEC(), but it requires more coding and is not so nice, as REQUERY() with new parameter.

Of course,
SELECT * FROM myTable WHERE myCodeField IN ?myCodeVariable
works fine if there just one value (i.e.
myCodeVariable = 'AAAA'
)

Sybase doesn't want to work with something like
SELECT * FROM myTable WHERE INLIST(myCodeField,&myCodeVariable)
So, we wouldn't like to create additional cursors,
based on our view, and we need more than one code value as a parameter, and we can't say exactly how many possible code values should be included into that IN clause.

I found the solution, where I create an object array property, say, aMyCodes[20] (because 20 is definitely more, than number of codes used). If I fill an array with, say, 15 codes and fill 5 elements left with SPACE(4), the remote view SQL statement like SELECT * FROM myTable WHERE myCodeField IN ?aMyCodes[1],?aMyCodes[2]...?aMyCodes[20] works.

But, may be I am missing something obvious here, and there is simpler solution?

Any ideas are appreciated.

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform