Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Pass a variable from the .DBC stored procedures ?
After getting a "light bulb" turned on from an answer yesterday, I have run into one unexpected snag.
I have a simple error handler procedure in my main.prg. In the .DBC stored procedures, I wrap an RI generated delete trigger function within my own UDF() in which I generate an error message that I want my error handler to use. I thought I could declare a PUBLIC variable in the main.prg and then have my UDF() feed it a text string. Is it possible for code in the .DBC stored procedures to toggle variables in the application ? If not, how might I pass a text string to the error handler while in the midst of an error condition ?
Here is the code in the .DBC:
FUNCTION delete_projects() &&Projects table DELETE trigger
lRetError = __ri_delete_projects() &&RI generated
IF lRetError = .F.
cRsrcError = "This Project cannot be deleted" &&Public var main.prg
Return .F. &&This will trigger the VFP error that I will catch
ELSE
RETURN .T.
ENDIF
As always, any help is greatly appreciated.
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement