Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Database View
Message
De
15/12/2004 09:19:08
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, États-Unis
 
 
À
13/12/2004 13:02:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00968799
Message ID:
00969421
Vues:
10
What do you mean by bloat in the dbc?

We did this because we are refreshing the data. What is the best way to refresh the data?

Jim

>Yes but still no need and would cause a bloat in dbc.
>Cetin
>
>>My mistake, I forgot to type the create view clause....
>>
>>
>>Jim
>>>>I'm trying to create a view based on a string and using the Execscript function, but it's not working and I don't know why. The error message is Syntax Error on the execscript function. Please take a look...
>>>>
>>>>
>>>>	LOCAL lcScript, lcStartDate, lcEndDate
>>>>	IF USED("deliveries")
>>>>		SELECT deliveries
>>>>		USE
>>>>		DROP VIEW deliveries
>>>>	ENDIF
>>>>	lcStartDate = ALLTRIM(STR(YEAR(Session.startdate))) + "-" + ;
> ALLTRIM(STR(MONTH(Session.startdate))) + "-" +;
> ALLTRIM(STR(DAY(Session.startdate))) + ' 00:00:00'
>>>>	lcEndDate = ALLTRIM(STR(YEAR(Session.EndDate))) + "-" + ;
> ALLTRIM(STR(MONTH(Session.EndDate))) + "-" + ;
> ALLTRIM(STR(DAY(Session.EndDate))) + ' 00:00:00'
>>>>	lcScript = "SELECT * FROM Deliveries"+ ;
>  " WHERE Deliveries.deliverydate >= "+;
>  "cast('" + ;
>  ALLTRIM(lcstartdate) + ;
>  "' as datetime) AND deliveries.deliverydate <= cast('" + ;
>  ALLTRIM(lcenddate) + "' as datetime)"
>>>>	EXECSCRIPT(lcScript)
>>>>	IF !USED("deliveries")
>>>>		USE deliveries IN 0
>>>>	ENDIF
>>>>
>>>
>>>Jim,
>>>Good it errored (cast in script was the cause I think).
>>>This sounds to be a preparation for SQL server. Instead of dropping, recreating (no recreation code there but I think you intended it) create a parametric view in the first place:
>>>
>>>
>>>create sql view deliveries ;
>>>  remote connection myConnection ;
>>>  as ;
>>>  select * FROM Deliveries ;
>>>  WHERE Deliveries.deliverydate between ?ldStartDate and ?ldEndDate
>>>
>>>
>>>ldStartDate = Session.startdate
>>>ldEndDate = Session.enddate
>>>use myDbc!deliveries in 0
>>>
>>>ldStartDate = date()-1000
>>>ldEndDate = date()
>>>requery('deliveries')
>>>
>>>Cetin
Thanks

Jim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform