Examine the following code that you plan to execute:
What correction should be performed in the above code?
A.
The PROC2 procedure code should be defined in the package body.
B.
The PROC3 procedure should be declared in the package specification.
C.
The PROC3 procedure header should be declared at the beginning of the package body.
D.
The variable x must be declared in the package body and removed from the specification
B is wrong.
A procedure in the body but not in the specification is just a private procedure and it’s completely valid. If you want two answers, then choose A & C, since if you try to reference PROC3 before it’s declaration you’ll get an error, or use forward declaration.
answer is A only.
Yes Answer is “A”
The answer should be AB.
Because question is What correction should be performed in the above code?
Answer is A only.
Answer is A because a package can have a Procedure only in Body section and it will be Privated, but if you declare a procedure on Specification of Package it must be implemented on Body Section. (Sorry about my english)
Only A
A is correct ans. For successful compilation of the code, proc2 which is declared in package specification must be defined in package body.
Yep, only A is correct answer.
PLS-00323
Error Description:
Subprogram or cursor “string” is declared in a package specification and *must* be defined in the package body.
B is wrong there could be procedure/function in body without declaration in specification. C could be done, but it’s not required. D is obviously wrong.
Both A and B. For B, true the procedure is valid but it’s useless unless it’s either declared under the package specification or a publicly available procedure such as PROC1 is calling PROC3 from within the package body.
And the reason D is wrong is because proc1 runs first and x is assigned the value of 1 before proc3 follows after that.
PLS-00323: subprogram or cursor ‘PROC2’ is declared in a package
specification and must be defined in the package body
Answer is A
if the proc3 proc is not defined inside the pkg spec then it is called as a PRIVATE PROCEDURE!!!
its called Information hiding
A
A