Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi-Parameterized Remote View
Message
From
06/03/1997 23:15:07
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00023255
Message ID:
00023260
Views:
27
>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

There's a big difference between "'AAAA','BBBB','CCCC'" and 'AAAA': the quotes.

Vlad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform