Oracle Error PLS-00323: subprogram or cursor is declared in a package specification and must be defined in the package body

前端 未结 3 961
有刺的猬
有刺的猬 2021-02-05 07:01

Can someone help me put my pl/sql procedure in a package? I\'ve tried and I\'m struggling with it:

This is what I have, for my package specification:

CRE         


        
3条回答
  •  别那么骄傲
    2021-02-05 07:25

    Your header and body procedure definitions don't match

    In the header, you have:

    PROCEDURE get_films(fname VARCHAR2);
    

    Whereas in the body:

    PROCEDURE get_films(fname IN film.title%type, 
       r_date OUT film.release_date%type, dur OUT film.duration%type)
    

    You probably just need to update the header definition with the two additional OUT params?

    To Summarize

    • Ensure the header definition matches all parameters of the body implementation (number of parameters, names of parameters, order of parameters, and the parameter types)
    • As per Alex's comment, do not mix and match the custom type (film.title%type) with the base type (VARCHAR2). Choose one or the other.

提交回复
热议问题