Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use of Stored Procedures
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00101049
Message ID:
00101287
Vues:
29
[Snip...]

>Dave & Josh:
>
>Thanks for the input - I am indeed trying to build an audit type of function where inserts into various tables are all logged in a journal type of table. While I think the 3 tier architecture really would do what I want, it is probably overkill for what I am trying to do.
>
>Anyway, I am looking at Stored Procedures and defining insert triggers. Is there any way to handle returning a code (i.e. 0=OK, 1=INVALID_DATA, etc) from AddToY() rather then .T. if added and .F. if not ? This may seem weird, but because I am doing lookups and inserts in the AddToY() function, I want to determine if the function failed because the lookup failed or if the insert failed. I know I can define the INSERT TRIGGER as __ri_insert_x() AND AddToY() = ADD_REC_OK, and the trigger will return .T. if AddToY() returned a certain value. The question is how do I return the result of AddToY() to the object that called the INSERT in the first place ?
>
>Sorry if this ambigous ...
>Thanks again
>Rob

I hope you don't mind my .02 but:

I can think of several ways to accomplish what you want. WHat you could do it populate a global array (kinda like your own AERROR() array) and deal with that when the trigger fails. You could access an object directly from the stored procedure (although that seems kinda messy to me).

I have written audit trail procedures before but I tend to think of them as tracking data access. I don't like linking my DBC to objects because that will fail if the users access the data outside my application. As a result, I have not hit ur problem.

Anyway, I hope this helps...
Menachem Bazian, CPA
President
BC Consulting Services, Inc.
973-773-7276
Menachem@BazianCentral.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform