Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Oracle Access
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00541480
Message ID:
00541549
Vues:
22
>I am currently using a DBC with a named connection and parameterized SQL >views. The problem that I am running into is that it takes too long to create >the views programatically and I am having to create too many views to meet the >needs of the parameters. Do you create your views programatically?

Yes. For example:
lnHandle = sqlconnect() && Use the proper arguments here for an ODBC connection.
lcSql = "select * from tableref order by tablerefno"
lnReturn = sqlexec(lnHandle,lcSql,'TMPCUR')
if allt(alias()) != "TMPCUR" or lnReturn < 1
	messagebox("No data returned from table reference.",0+48+0,"dsio.prg")
	return -1
else
	select tmpcur
	cursorsetprop("Tables","dbo.Tableref")
	cursorsetprop("UpdateNameList","tablerefno dbo.tableref.tablerefno,sourcerefno dbo.tableref.sourcerefno,"+;
	                               "tablename dbo.tableref.tablename,tablewidth dbo.tableref.tablewidth,"+;
	                               "lastupdate dbo.tableref.lastupdate,datename dbo.tableref.datename,"+;
	                               "dest dbo.tableref.dest,subquery dbo.tableref.subquery,note dbo.tableref.note")
	cursorsetprop("KeyFieldList",'tablerefno')
	cursorsetprop("UpdatableFieldList","tablerefno,sourcerefno,tablename,tablewidth,"+;
	                                   "lastupdate,datename,dest,subquery,note")
	cursorsetprop("SendUpdates",.T.)
	cursorsetprop("Buffering", 3)
endif

&& Do whatever you want to the cursor here

Tableupdate(.T.,.T.)
lcSql can have a where clause with as many filter conditions as you want and can join as many tables as you want using the proper SQL syntax for the backend you are using. This particular piece is used with sybase.

The tableupdate sends updates to the backend. This is an example and can not be cut and pasted but you should get the idea. This way is much faster than DBC view definitions. Also, make sure you understand how your buffering set.
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform