Search code examples
oracle-databaseplsqlsql-navigator

PL/SQL - Can't create package because of my function


Im trying to create a package and it works with procedures-only. As soon as I try to add a function following errors appear:

    15:47:11  line 1: ORA-24344: success with compilation error
15:47:11  14/3    PLS-00103: Encountered the symbol "TITLE" when expecting one of the following:
15:47:11            . @ % ; is default authid as cluster order using external
15:47:11            character deterministic parallel_enable pipelined aggregate
15:47:11            result_cache accessible rewrite
15:47:11            The symbol ";" was substituted for "TITLE" to continue.

My code:

create or replace package job_pkg is

  procedure add_job 
  (jobid jobs_test.job_id%type, jobtitle jobs_test.job_title%type);
  ---------------------------------------------------------------------
  procedure upd_job 
  (alt jobs_test.job_id%type, neu jobs_test.job_id%type);
  ---------------------------------------------------------------------
  procedure del_job 
  (jobid jobs_test.job_id%type);
  ---------------------------------------------------------------------
  function get_job
  (id jobs_test.job_id%type) return varchar2 
  title jobs_test.job_title%type;

end job_pkg;

Thank you in advance


Solution

  • You're missing a semicolon.

      function get_job
      (id jobs_test.job_id%type) return varchar2;
    
      title jobs_test.job_title%type;
    

    Assuming you're creating a package level variable 'title' AND declaring your function spec here.