Welcome! Log In Create A New Profile

Advanced

Hyper File Triggers and Stored Procedures

Posted by Andrew Jones 
Andrew Jones
Hyper File Triggers and Stored Procedures
August 05, 2008 10:42AM
Hello

I have a program that uses client/server for managing its hyper files, and I was trying to set up a stored procedure on the server. I want to run the procedure whenever a particular hyper file is modified or added to and managed to set up a trigger and associate it with the right hyper files.

My problem is that my stored procedure takes a couple of parameters, but I can't see a way to pass these parameters to the stored procedure through an automatic trigger. Am I missing something obvious? Any help would be greatly appreciated, thanks.

Andrew Jones
GuenterP
Re: Hyper File Triggers and Stored Procedures
August 05, 2008 01:57PM
Quote
Andrew Jones
Hello

I have a program that uses client/server for managing its hyper files, and I was trying to set up a stored procedure on the server. I want to run the procedure whenever a particular hyper file is modified or added to and managed to set up a trigger and associate it with the right hyper files.

My problem is that my stored procedure takes a couple of parameters, but I can't see a way to pass these parameters to the stored procedure through an automatic trigger. Am I missing something obvious? Any help would be greatly appreciated, thanks.

Andrew Jones

Hi,

there are stored procedures (since WD11, with parameters) and stored triggers (since WD12, without parameters). The direction of action is important: Your program calls a procedure and does something there - parameters required, otherwise its called a function. ... A trigger is triggered by file operation and the procedure of the trigger does something - no parameters required. So, I have to ask you: why the hell should a trigger procedure have parameters ? An example, please ..

Kind regards,
Guenter
Andrew Jones
Re: Hyper File Triggers and Stored Procedures
August 05, 2008 04:15PM
I think what I need is a stored procedure called from the program code, except there are a few procedures that are called very frequently (whenever there is an addition or modification of a file) and I would have preferred to have to procedures called automatically. As it is I'm having to call them from the code everywhere there is a modification to particular files, and its getting tricky to keep track of.

Seems like theres no way round it though.
David Egan
Re: Hyper File Triggers and Stored Procedures
August 05, 2008 09:27PM
Hi Andrew
I haven't played around with stored procedures but I would be inclined to make a "FileManager" class, with methods for adding, modifying and so on and then instantiate that for each file. I would have a private method within the class the equivalent of the stored procedure but there is probably no reason why you couldn't call the stored proc directly from the class. You can easily pass parameters to your methods and within your program you can just call something like Debtors.AddRec(parameters) and so on.

Cheers

David
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: