Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to tell which default expression called stored proce
Message
 
 
À
09/07/2001 15:02:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00527825
Message ID:
00528304
Vues:
22
>>>>This is a function you wrote? Couldn't you pass the name of the field?
>>>
>>>Yes Nancy, but I wondered if one could. It's not earthshaking if I have to pass the name of the field. Perhaps I've gotten too used to being able to get that sort of info :)
>>
>>Er..what "sort of info?" I'm trying to think of an analogy, and am not. I'll be terrifically interested to hear if the runtime exposes to a function the field that has triggered a default expression call. Perhaps, somehow with 7.0 database events, it's more possible to control that.
>>
>>But, with GetID() functions, for example, I've always done, and have always seen others do this, too...that is call the func with the table and field name (unless one can _assume_ what the field name is).
>
>Nancy,
>
>By "that sort of info" I meant the following, for instance:
>1) If parameter is tcAlias, but it wasn't passed, use ALIAS() as default;
>2) If parameter is tcDBC, but it wasn't passed, use DBC() as default
>
>It is not critical, but it would simplify what you have to remember to do. My equivalent of GetID() is exactly the place where I was going to use it.
>
>Alex

Hi Alex,
Unfortunately this doesn't work in VFP. In cases where you use the SQL Insert command, VFP internally opens the database and table but never makes them active. Functions like DBC(), SET("DATABASE") and ALIAS() return nothing or erroneous information.

FWIW, if the default value function is in the DBC (i.e. store procedure), you can get the name of the DBC using juststem(sys(16,1)). SYS(16) will return the procedure name with the procedure file speficied as the DCT (memo file) associated with the database. To see if the function is a stored procedure, check the extension justext(sys(16,1)) to see if it is "DCT".
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform