Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clearing Views/Cursors
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Clearing Views/Cursors
Divers
Thread ID:
00318092
Message ID:
00318092
Vues:
49
I programatically create a view from a parametised query.
Once I have pulled the data from this and appended it to a local table drop the view.
However they are not being detroyed - when the program finishes you can select and brow the views created.
DO WHILE .NOT. EOF()
StartDate = ALLTRIM(THISFORM.Text2.TEXT)
EndDate = ALLTRIM(THISFORM.Text3.TEXT)
MSID = msid.msid
Viewname = MSID
CREATE SQL VIEW &Viewname REMOTE;
CONNECTION ConnectionSPS SHARE ;
AS SELECT Sts_metered_kwh.ST_MTS_ID...
...Sts_metered_kwh.kwh_total ;
FROM SPS.Sts_metered_kwh Sts_metered_kwh;
WHERE ;
Sts_metered_kwh.GMT_DATE >= TO_DATE('&StartDate','dd/mm/yyyy');
AND Sts_metered_kwh.GMT_DATE <= TO_DATE('&EndDate','dd/mm/yyyy');
AND Sts_metered_kwh.ST_MTS_ID = '&MSID'

SELECT * FROM &Viewname INTO table mydata
SELECT importsts
APPEND FROM mydata
DROP VIEW &Viewname
SELECT msid
SKIP 1
ENDDO

What can I do to clear the cursor? I only found out when I tried to process a couple of hundred records in the DO WHILE and got a maximum numbers of cursors exceeded error.
Thanks in advance.
Martin
If only everything in life was as reliable as VFP
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform