Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Private datasessions for functions and procedures
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00291735
Message ID:
00291994
Vues:
25
>I would like my functions and procedures to have private datasessions. Three reasons:
>
>- function/procedure calls will not change the state of tables
>- makes it explict which tables a function/procedure uses
>- automatically closes all temporary cursors
>
>Can anyone point to towards some resources on how to do this? Any the cons to this idea?

Hey Evan,

DEFINE CLASS Process AS SESSION

PROCEDURE UpdateStatus
LPARAMETER tnNewStatus,tdWeekend,tcUserid

USE DATA\pay_tran SHARED IN 0
SELECT pay_tran

*-- Process data here...

USE IN pay_tran

ENDPROC
ENDDEFINE

The Session class is the ticket. By default it creates it's own data session.

loUpdate = CREATEOBJECT("Process")
loUpdate.UpdateStatus(3,THIS.dWeekend,THISFORM.oApp.cCurrentUser)
RELEASE loUpdate

Bill
Heavy Metal Pedal - click with care
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform