i keep getting the following errror, 'ORA-01008: not all variables bound', im guessign its all based on my pPostcode param but im not sure. I am a beginner the the whole PLSQL secne and any help would be greatly apriciated
here is my procedure:
procedure all_customer_postcode(pPostcode in carer.postcode%type
,pReport out SYS_REFCURSOR) is
begin
open pReport for
select c.id, c.forename, c.surname,c.address_1,c.address_2,
c.address_3,c.address_4, c.postcode, c.date_of_birth, cf.id
from customer c, customer_friend cf,customer_friend_for cff
where c.id = cff.customer_id AND cff.id = cff.customer_friend_id
AND c.postcode = pPostcode;
end;
Thanks Jon
I have amended your procedure slight, as the WHERE clause you published didn't make sense to me...
Calling it in SQL*Plus with variables works ...
So, how can we get it to hurl an ORA-1008? By turning the query into a string and changing the way the parameter is declared...
so let's fix that ...
So I have managed to recreate an ORA-1008; I'm not sure whether it matches your ORA-1008 situation. Your intuition is right, it is something to do with how the value in
pPostcode
is passed to the query. It is just that the code you posted actually does it correctly and so doesn't fail.