Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remote view TOP n with n as a param
Message
 
À
18/11/2013 14:33:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01588219
Message ID:
01588307
Vues:
67
J'aime (1)
>I've been trying to get this to work with ODBC and SPT but if i read the VFP docs correctly a param can't be part of a SELECT statement. Anyway. so far no luck but I'm not sure it is critical to the app and seems like kind of a half assed approach to do in on the back end when it is a VFP app and the potential result set is really small anyway.

You can do this one of two ways:
LOCAL lnRows

lnRows = 10
SET STEP ON 
TEXT TO lcSQL NOSHOW TEXTMERGE
   DECLARE @RowsToGet INT
   SET @RowsToGet = <<m.lnRows>>
   SELECT TOP (@RowsToGet) * FROM SomeTable ORDER BY SomeField
ENDTEXT 

?SQLEXEC(m.lnHandle, m.lcSQL, "curResults1")


LOCAL lnRows

lnRows = 10

TEXT TO lcSQL NOSHOW 
   DECLARE @RowsToGet INT
   SET @RowsToGet = ?m.lnRows
   SELECT TOP (@RowsToGet) * FROM SomeTable ORDER BY SomeField
ENDTEXT 

?SQLEXEC(m.lnHandle, m.lcSQL, "curResults2")
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform