Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using LSQLPT Cursors
Message
De
16/02/2006 04:23:08
 
 
À
15/02/2006 19:14:05
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Divers
Thread ID:
01096583
Message ID:
01096682
Vues:
15
>I'm definitely missing something then.

You certainly are <s>.

>I had assumed that the LSQLPT was just a refinement on this

Nope.

>and that the LSQLPT based on a local view would be updateable.
>But this isn't true?

No. LSQLPT isn't based on a local view - its based on an ad-hoc SQL select statement specified in the cSource statement running against local Fox data.

>Is there any way to implement a dynamic where clause against a local view using the Codemine classes?

Nope. The dynamic where clause is only available (for read/write/update) against remote data i.e., SQL server utilising a remote view. This is because Codemine analyses the remote view definition you define as the SQLPT cursor's cSource value and creates a SQL Pass-Thru class based on the directives you have specified in the remote view definition. If the WHERE clause is changed dynamically in this scenario, then all that changes is the SQL pass-thru code that is generated "on the fly". Then, before a SELECT query using the pass-thru, Codemine just reads the "latest" value of the cWhere property on the cursor object. If you have changed it mid-stream, the pass-thru based SELECT simply includes whatever value it finds in the cWhere property.

So, the remote view isn't actually used; only the settings that define it are used. You can have a dynamic LSQLPT cursor but it is read-only - just like if you create a cursor from a standard VFP SQL select statement against a .DBF.

If you want updateable local data using a view, in Codemine, your only option is a local view. One of the restrictions of using views is that the properties of the view are embedded in the DBC and they simply cannot be changed at run-time. So, the SQLPT cursor class is created by reading the remote view definition at the outset but after that, this definition can be changed because it is just SQL pass-thru code.

If it helps, I can tell you that whilst the dynamic WHERE clause sounds good, in practice, I have never found much of a use for it where you have a well designed database.

HTH
-=Gary
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform