Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Linked server syntax fun
Message
From
10/12/2008 14:04:15
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01366470
Message ID:
01366507
Views:
11
It won't work. You cannt have a var inside of a pass-through query.

>>That what openquery is for. You can send pass-through query to the specified linked server. Fox is in my case.
>>Problem is to build a complete string with parameters. Too many quotes.
>
>If the linked server is Fox and you want to use strings do this:
>
>
>select * from openquery(VAMCPD,'select a.cItemno,a.nShipQty,a.nSalesAmt-a.nDiscAmt as Amt
>                                       from aritrs a
>                                inner join arinvc b on a.cInvNo=b.cInvNo
>                                where a.cCustno+a.cInvNo like "'+@StringPar+'%" and cType= ""')
>
>this is not tested.
>As you see you can use double quotes ub the query string if the linked server accepts them.
>
>You even can use square brackets:
>
>select * from openquery(VAMCPD,'select a.cItemno,a.nShipQty,a.nSalesAmt-a.nDiscAmt as Amt
>                                       from aritrs a
>                                inner join arinvc b on a.cInvNo=b.cInvNo
>                                where a.cCustno+a.cInvNo like ['+@StringPar+'%] and cType= []')
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform