Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Linked server syntax fun
Message
 
À
10/12/2008 13:11:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01366470
Message ID:
01366499
Vues:
10
>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= []')
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform