use of procedures [message #584116] |
Wed, 08 May 2013 14:56 |
|
jay_cooldude
Messages: 50 Registered: March 2013 Location: Hyd
|
Member |
|
|
Hi,
i just want to know how can i create a procedure in the program unit and assign the output to a field
in the report. thanks in advance.
Regards,
Jay.
|
|
|
|
|
|
|
Re: use of procedures [message #584122 is a reply to message #584121] |
Wed, 08 May 2013 15:35 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
RETURN is enough; you don't need to use the same code in a formula column again. Why would you?
Of course, that's a perfectly valid option - put the whole code into the formula column. But, in that case, you don't need that function at all.
However, if you want to call a function with different parameters from different formula column (for some reason), then a function is a better choice because every formula would just RETURN function's value. If anything changes in code, you maintain it only for the function - its calls from formula columns remain intact.
[Updated on: Wed, 08 May 2013 15:35] Report message to a moderator
|
|
|
|
Re: use of procedures [message #584131 is a reply to message #584125] |
Thu, 09 May 2013 00:12 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Certainly, you can use these as well, no problem.
For example: create a procedure which initializes some tables which are then used in report's query. You'd call that procedure from the After Parameter Form trigger.
Or, you want to log who and when executed that report - create a procedure which does that job and call it from the After Report trigger.
Packages are an "extension" to standalone functions/procedures (as they are packed into a package), so ... no problem in using them as well.
|
|
|