Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Flexible ordering in SQL View
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Flexible ordering in SQL View
Divers
Thread ID:
00187350
Message ID:
00187350
Vues:
56
I am trying to add more flexible sort ordering to my SQL Views (local and Remote). The following syntax seems to work:

CREATE SQL VIEW v_TestOrder ;
AS ;
SELECT *;
FROM Table1;
WHERE Field1 LIKE ?pcField1;
ORDER BY ?pnOrder

If I use v_testOrder, I get the standard vfp dialog box asking for pcField1 and then pnOrder and the data is then ordered in the view by pnOrder.

I have two problems:

1.) If I pre-define pnOrder to be 1 and then open or requery() v_testOrder, I will get an error message: "SQL: Column PNORDER is not found" --> the ?pnOrder only seems to work via VFP dialog input.

2.) If I can ever solve 1.), I would like to use a field name (character) for ?pnOrder (ok - ?pcOrder) instead of using a number. Using a field name -- Field1 or "Field1" causes SQL: Column '' Not Found error.

Thanks for any help or alternatives to ordering views.

Kevin
Kevin Emmrich
www.jkt9000.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform