I'm having trouble calling this stored procedure.
As an anon procedure it works fine, and it will accept the title_id and return the authors for the book:
Below, I get a PLS-00306 wrong number of types or arguments error
*********************************************************
- Code: Select all
set serveroutput on
create or replace procedure
list_authors
(v_title_id in varchar2, v_au_lname out varchar2)
is
cursor
c1
is
select
au_lname
from
titles t,
titleauthor ta,
authors a
where
t.title_id = ta.title_id
and
ta.au_id = a.au_id
and
t.title_id = 'v_title_id';
BEGIN
open c1;
loop
fetch c1 into v_au_lname;
EXIT WHEN c1%NOTFOUND;
dbms_output.put_line(v_au_lname);
end loop;
close c1;
EXCEPTION
WHEN OTHERS THEN raise_application_error(-20001,'An error - '||SQLCODE||' -ERROR- '||SQLERRM);
end;
/
exec list_authors('TC7777');