Package Body sequence [message #10970] |
Thu, 26 February 2004 05:44 |
dadba
Messages: 34 Registered: February 2003
|
Member |
|
|
Hello
We have a package with several procedures and functions.
Question is:
Do the procedures/functions get executed in the order they
are placed within the package. We have a procedure that
should execute before another procedure. It is a validation
procedure that is firing after the fact and data validation
is not being caught before insert to table.
thanks in advance
|
|
|
Re: Package Body sequence [message #10971 is a reply to message #10970] |
Thu, 26 February 2004 06:37 |
Satish Shrikhande
Messages: 167 Registered: October 2001
|
Senior Member |
|
|
Package specification
procedure main
procedure proc1
procedure proc2
procedure proc3
package Body
procedure proc1 as ...
procedure proc2 as ...
procedure proc3 as ...
main -- Call the procedure in the sequnce you want
proc3 -- call first the validation procedure
proc2 -- Next will be your INSERT procedure
proc1
|
|
|
Re: Package Body sequence [message #10972 is a reply to message #10971] |
Thu, 26 February 2004 06:51 |
dadba
Messages: 34 Registered: February 2003
|
Member |
|
|
thanks Satish...
so you place the sequence of execution in the
"main" block.
I'm looking at a package written by someone else
and I don't recall seeing a Main section..I'll
go back and take a look.
thanks again..
|
|
|
Re: Package Body sequence [message #10975 is a reply to message #10972] |
Thu, 26 February 2004 08:05 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
No, there isn't a "MAIN" section - the example was just using MAIN to refer to the program that calls the procs/functions in the package. You don't control the order to calling in the package - the calling program can execute them in whatever order it wants to.
|
|
|
Re: Package Body sequence [message #10977 is a reply to message #10970] |
Thu, 26 February 2004 12:20 |
William Robertson
Messages: 1643 Registered: August 2003 Location: London, UK
|
Senior Member |
|
|
> Do the procedures/functions get executed in the order they are placed within the package?
No. A package is not a single program that is run from top to bottom - it is a library of procedures, functions, definitions etc that are available to be used in whatever way other programs see fit. You need to look at whatever is calling these two procedures in the wrong order.
|
|
|
Re: Package Body sequence [message #10986 is a reply to message #10975] |
Fri, 27 February 2004 05:04 |
dadba
Messages: 34 Registered: February 2003
|
Member |
|
|
thanks to all...
ok..I see what your saying...I need to find
the calling procedure or function
that executes the Package in question and look
at the order from there.
got it!
|
|
|