Further to this discussion here is data from documentation on triggers. In my opinion the key operative is that " Procedures that are run with triggers must be stored with no arguments". In my opinion this means that triggers SHOULD NOT be defined in PUT with a Return argument. Granted PUT would alllow you to do so because it does not know that the Store Procedure is really a TRIGGER. As currently implemented in RBase Stored Procedure and Stored Functions are stored the same way internally. Many other implementations have two different internal storages that distinguish between store procedure and stored functions.
Jim Bentley American Celiac Society [email protected] tel: 1-504-737-3293 ________________________________ From: James Bentley <[email protected]> To: RBASE-L Mailing List <[email protected]> Sent: Thu, January 14, 2010 3:19:00 PM Subject: [RBASE-L] - Re: date tracking question Bill, As I stated in additional correspondence. You only return a value when your stored procedure serves as a "function." Jim Bentley American Celiac Society [email protected] tel: 1-504-737-3293 ________________________________ From: Bill Downall <[email protected]> To: RBASE-L Mailing List <[email protected]> Sent: Thu, January 14, 2010 12:00:43 PM Subject: [RBASE-L] - Re: date tracking question It's not so much that triggers return values, but stored procedures can. In the help files, read "using stored procedures." For example, you can call a stored procedure to set a variable to the value after the last "RETURN value" statement. Dennis, you were still the developer of R:Style back in 6.5 when "RETURN value" became a valid syntax. I can't remember what change you had to make to R:Style then, but you had to do something to distinguish it from the RETURN at the end of a command file. Bill On Thu, Jan 14, 2010 at 12:32 PM, James Bentley <[email protected]> wrote: Albert, >>I am curious where you found this tidbit of info in the documentation. > >>I was under the impression that Triggers were not supposed to RETURN values >>since They are automatically called and have no way for the user to interact >>with them after they complete execution. > >> Jim Bentley >>American Celiac Society >[email protected] >>tel: 1-504-737-3293 > > > >>----- Original Message ---- >>From: Albert Berry <[email protected]> >>To: RBASE-L Mailing List <[email protected]> >>Sent: Thu, January 14, 2010 10:34:19 AM >>Subject: [RBASE-L] - Re: date tracking question > >>Hi, all. The system expects the trigger to return a value to a calling >>procedure. Zero is as good as anything. >>Albert > >[email protected] wrote: >>> Dennis: I actually have no clue what the RETURN 0 is for. >>> This code is in my notes document, I've never had a reason to >>> use it yet, so this was just a copy and paste of someone else's >>> suggestion. I don't think I've ever used RETURN 0. >>> >>> Karen >>> >>> >>>> Thanks, >>>> >>>> I’ve got a demo running nicely, thanks to you and Emmitt. >>>> >>>> What is the 0 after your returns? >>>> >>>> >>>> >>>> >>>> *From:* [email protected] [mailto:[email protected]] *On Behalf Of >>>> *[email protected] >>>> *Sent:* Wednesday, January 13, 2010 4:22 PM >>>> *To:* RBASE-L Mailing List >>>> *Subject:* [RBASE-L] - Re: date tracking question >>>> >>>> >>>> >>>> >>>> I think a variable is the ONLY way. Here's example code: >>>> >>>> SET VAR trigger_executed INTEGER >>>> IF trigger_executed = 1 THEN >>>> CLEAR VAR trigger_executed >>>> RETURN 0 >>>> ENDIF >>>> ... {body of trigger} >>>> SET VAR trigger_executed INTEGER = 1 >>>> RETURN 0 >>>> >>>> >>>> >>> > > > > > >

