Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using IN operator in parameterized remote view.
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Using IN operator in parameterized remote view.
Miscellaneous
Thread ID:
00520273
Message ID:
00520273
Views:
45
I'm having difficutly using the IN operator in the parameter statement in a remote view against a SQL Server table. Here is my view:

CREATE SQL VIEW "V_CUSTOMERS" ;
REMOTE CONNECT "My_Connection" AS ;
SELECT ;
Customers.icustomerid,;
Customers.cname,;
Status.cstatus ;
FROM Customers ;
LEFT JOIN Status ON Status.istatusid = Customers.istatusid ;
WHERE CAST(Customers.icustomerid as CHAR(20)) IN (?vp_cCustomerIdList) ;
ORDER BY Customers.cname

I tried performing this same operation using SPT in the following statement:

lcList = '1,2,3,4'
lcCmd = 'select cname from customers where cast(icustomerid as char(20)) in (?lcList)'
? sqlexec(lnHandle,lcCmd)

I have tried changing the parameter (lcList) to the following without success:

lcList = ['1','2','3','4']

If I don't execute this as a parameter, then it will work:

lcCmd = 'select cname from customers where cast(icustomerid as char(20)) in (' + lcList + ')'
? sqlexec(lnHandle,lcCmd)

I really need to set this up as a parameterized view. Is there something that I am missing here or is what I am trying to accomplish just not work?

Please help! I really would appreciate it.

TIA,

James
James Moore
Owner/Developer
Ministry Tracking Software, Inc.
www.youthtrack.com
Next
Reply
Map
View

Click here to load this message in the networking platform